Update README.md
Browse files
README.md
CHANGED
@@ -14,18 +14,20 @@ You can use it like this:
|
|
14 |
|
15 |
|
16 |
```python
|
17 |
-
|
18 |
-
|
19 |
-
load_in_8bit=LOAD_8BIT,
|
20 |
-
torch_dtype=torch.float16,
|
21 |
-
device_map="auto",
|
22 |
-
)
|
23 |
-
model = PeftModel.from_pretrained(
|
24 |
-
model,
|
25 |
-
"Chinese-Vicuna/Chinese-Vicuna-lora-13b-belle-and-guanaco",
|
26 |
-
torch_dtype=torch.float16,
|
27 |
-
device_map={'': 0}
|
28 |
-
)
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
```
|
31 |
|
|
|
14 |
|
15 |
|
16 |
```python
|
17 |
+
from transformers import LlamaForCausalLM
|
18 |
+
from peft import PeftModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
+
model = LlamaForCausalLM.from_pretrained(
|
21 |
+
"decapoda-research/llama-13b-hf",
|
22 |
+
load_in_8bit=True,
|
23 |
+
torch_dtype=torch.float16,
|
24 |
+
device_map="auto",
|
25 |
+
)
|
26 |
+
model = PeftModel.from_pretrained(
|
27 |
+
model,
|
28 |
+
LORA_PATH, # specific checkpoint path from "Chinese-Vicuna/Chinese-Vicuna-lora-13b-belle-and-guanaco"
|
29 |
+
torch_dtype=torch.float16,
|
30 |
+
device_map={'': 0}
|
31 |
+
)
|
32 |
```
|
33 |
|