cognitivess
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -5,16 +5,13 @@
|
|
5 |
To use this model, first install the custom package:
|
6 |
|
7 |
```bash
|
8 |
-
pip install
|
|
|
9 |
```
|
10 |
|
11 |
Then, you can use the model like this:
|
12 |
|
13 |
```python
|
14 |
-
# Install required packages
|
15 |
-
#pip install bitsandbytes accelerate
|
16 |
-
#pip install git+https://huggingface.co/CognitivessAI/cognitivess
|
17 |
-
|
18 |
# Import necessary libraries
|
19 |
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
20 |
import torch
|
@@ -29,11 +26,19 @@ AutoModelForCausalLM.register(CognitivessConfig, CognitivessForCausalLM)
|
|
29 |
# Set up quantization config
|
30 |
quantization_config = BitsAndBytesConfig(load_in_8bit=True)
|
31 |
|
32 |
-
# Load tokenizer
|
33 |
tokenizer = AutoTokenizer.from_pretrained("CognitivessAI/cognitivess")
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
"CognitivessAI/cognitivess",
|
36 |
-
|
37 |
device_map="auto"
|
38 |
)
|
39 |
|
|
|
5 |
To use this model, first install the custom package:
|
6 |
|
7 |
```bash
|
8 |
+
!pip install bitsandbytes accelerate
|
9 |
+
!pip install git+https://huggingface.co/CognitivessAI/cognitivess
|
10 |
```
|
11 |
|
12 |
Then, you can use the model like this:
|
13 |
|
14 |
```python
|
|
|
|
|
|
|
|
|
15 |
# Import necessary libraries
|
16 |
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
|
17 |
import torch
|
|
|
26 |
# Set up quantization config
|
27 |
quantization_config = BitsAndBytesConfig(load_in_8bit=True)
|
28 |
|
29 |
+
# Load tokenizer
|
30 |
tokenizer = AutoTokenizer.from_pretrained("CognitivessAI/cognitivess")
|
31 |
+
|
32 |
+
# Load model configuration
|
33 |
+
config = CognitivessConfig.from_pretrained("CognitivessAI/cognitivess")
|
34 |
+
|
35 |
+
# Set the quantization config in the model configuration
|
36 |
+
config.quantization_config = quantization_config
|
37 |
+
|
38 |
+
# Load model with the updated configuration
|
39 |
+
model = CognitivessForCausalLM.from_pretrained(
|
40 |
"CognitivessAI/cognitivess",
|
41 |
+
config=config,
|
42 |
device_map="auto"
|
43 |
)
|
44 |
|