File size: 1,080 Bytes
ed980e5
53d674b
ed980e5
53d674b
2573c5e
 
 
 
e3f9266
 
ed980e5
53d674b
ed980e5
d981a81
 
 
53d674b
d981a81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53d674b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Cognitivess Model

## Usage

To use this model, first install the custom package:

```bash
pip install git+https://huggingface.co/CognitivessAI/cognitivess
```

Then, you can use the model like this:

```python
# pip install bitsandbytes accelerate
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
import torch

# Set up quantization config
quantization_config = BitsAndBytesConfig(load_in_8bit=True)

# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("CognitivessAI/cognitivess")
model = AutoModelForCausalLM.from_pretrained(
    "CognitivessAI/cognitivess",
    quantization_config=quantization_config,
    device_map="auto"  # This will automatically distribute the model across available GPUs
)

# Prepare input
input_text = "Write me a poem about Machine Learning."
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")

# Generate output
with torch.no_grad():
    outputs = model.generate(**inputs, max_length=100)

# Decode and print the result
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```