Spaces:
Runtime error
Runtime error
shljessie commited on
Commit ·
34849f2
1
Parent(s): 9bb1dd2
use local model
Browse files
app.py
CHANGED
|
@@ -17,7 +17,8 @@ As a derivate work of [ConsistentAgents]() by Seonghee Lee.
|
|
| 17 |
|
| 18 |
if torch.cuda.is_available():
|
| 19 |
model_id = "./backprop_llama2_69_1e-05"
|
| 20 |
-
|
|
|
|
| 21 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 22 |
tokenizer.use_default_system_prompt = False
|
| 23 |
|
|
|
|
| 17 |
|
| 18 |
if torch.cuda.is_available():
|
| 19 |
model_id = "./backprop_llama2_69_1e-05"
|
| 20 |
+
HF_ACCESS_TOKEN = os.getenv('HF_ACCESS_TOKEN')
|
| 21 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, use_auth_token=HF_ACCESS_TOKEN, torch_dtype=torch.float16, device_map="auto")
|
| 22 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 23 |
tokenizer.use_default_system_prompt = False
|
| 24 |
|