Spaces:
Runtime error
Runtime error
pivovalera2012
commited on
Commit
•
40680cb
1
Parent(s):
5f3ad9e
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
import torch
|
2 |
import gradio as gr
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
-
|
5 |
-
|
6 |
|
7 |
MODEL_NAME = 'meta-llama/Llama-2-7b-chat-hf'
|
8 |
ADAPTERS_NAME = 'pivovalera2012/Llama-2-7b-Dr-Hous-test'
|
9 |
|
10 |
model_trained = AutoModelForCausalLM.from_pretrained(MODEL_NAME,
|
11 |
-
|
12 |
|
13 |
model_trained = PeftModel.from_pretrained(model_trained, ADAPTERS_NAME)
|
14 |
model_trained = model_trained.merge_and_unload()
|
|
|
1 |
import torch
|
2 |
import gradio as gr
|
3 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
4 |
+
import os
|
5 |
+
HF_TOKEN = os.getenv('token')
|
6 |
|
7 |
MODEL_NAME = 'meta-llama/Llama-2-7b-chat-hf'
|
8 |
ADAPTERS_NAME = 'pivovalera2012/Llama-2-7b-Dr-Hous-test'
|
9 |
|
10 |
model_trained = AutoModelForCausalLM.from_pretrained(MODEL_NAME,
|
11 |
+
HF_TOKEN)
|
12 |
|
13 |
model_trained = PeftModel.from_pretrained(model_trained, ADAPTERS_NAME)
|
14 |
model_trained = model_trained.merge_and_unload()
|