Update README.md
Browse files
README.md
CHANGED
@@ -15,6 +15,12 @@ This is a version of `hivemind/gpt-j-6B-8bit` for low-RAM loading, i.e., free Co
|
|
15 |
|
16 |
> **NOTE:** PRIOR to loading the model, you need to "patch" it to be compatible with loading 8bit weights etc. See the original model card above for details on how to do this.
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
```python
|
19 |
import transformers
|
20 |
from transformers import AutoTokenizer
|
@@ -27,7 +33,8 @@ tokenizer = AutoTokenizer.from_pretrained("ethzanalytics/gpt-j-6B-8bit-sharded")
|
|
27 |
|
28 |
model = GPTJForCausalLM.from_pretrained(
|
29 |
"ethzanalytics/gpt-j-6B-8bit-sharded",
|
30 |
-
|
31 |
-
max_shard_size=f"1000MB",
|
32 |
)
|
33 |
-
```
|
|
|
|
|
|
15 |
|
16 |
> **NOTE:** PRIOR to loading the model, you need to "patch" it to be compatible with loading 8bit weights etc. See the original model card above for details on how to do this.
|
17 |
|
18 |
+
install `transformers` and `accelerate` if needed:
|
19 |
+
```sh
|
20 |
+
pip install transformers accelerate
|
21 |
+
```
|
22 |
+
Patch the model, load using `device_map="auto"`:
|
23 |
+
|
24 |
```python
|
25 |
import transformers
|
26 |
from transformers import AutoTokenizer
|
|
|
33 |
|
34 |
model = GPTJForCausalLM.from_pretrained(
|
35 |
"ethzanalytics/gpt-j-6B-8bit-sharded",
|
36 |
+
device_map="auto",
|
|
|
37 |
)
|
38 |
+
```
|
39 |
+
|
40 |
+
Take a look at the notebook for details.
|