minemisoe commited on
Commit
a8e9201
1 Parent(s): 87c1bd8

create app

Browse files
Files changed (1) hide show
  1. app.py +15 -0
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
+ )