Spaces:
Runtime error
Runtime error
create app
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import LlamaForCausalLM
|
2 |
+
from peft import PeftModel
|
3 |
+
|
4 |
+
model = LlamaForCausalLM.from_pretrained(
|
5 |
+
"decapoda-research/llama-13b-hf",
|
6 |
+
load_in_8bit=True,
|
7 |
+
torch_dtype=torch.float16,
|
8 |
+
device_map="auto",
|
9 |
+
)
|
10 |
+
model = PeftModel.from_pretrained(
|
11 |
+
model,
|
12 |
+
LORA_PATH, # specific checkpoint path from "Chinese-Vicuna/Chinese-Vicuna-lora-13b-belle-and-guanaco"
|
13 |
+
torch_dtype=torch.float16,
|
14 |
+
device_map={'': 0}
|
15 |
+
)
|