Chinese
English
lu-vae commited on
Commit
8965e22
·
1 Parent(s): fb6a9cb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +14 -12
README.md CHANGED
@@ -14,18 +14,20 @@ You can use it like this:
14
 
15
 
16
  ```python
17
- model = LlamaForCausalLM.from_pretrained(
18
- "decapoda-research/llama-13b-hf",
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