Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,13 +9,15 @@ HF_TOKEN = os.environ.get("HF_TOKEN")
|
|
9 |
model_id = "JerniganLab/interviews-and-qa"
|
10 |
base_model = "meta-llama/Meta-Llama-3-8B-Instruct"
|
11 |
|
|
|
|
|
12 |
pipeline = transformers.pipeline(
|
13 |
"text-generation",
|
14 |
-
model=
|
15 |
model_kwargs={"torch_dtype": torch.bfloat16},
|
16 |
device="cuda",
|
17 |
)
|
18 |
-
pipeline.model = PeftModel.from_pretrained(
|
19 |
|
20 |
def chat_function(message, history, system_prompt, max_new_tokens, temperature):
|
21 |
messages = [{"role":"system","content":system_prompt},
|
|
|
9 |
model_id = "JerniganLab/interviews-and-qa"
|
10 |
base_model = "meta-llama/Meta-Llama-3-8B-Instruct"
|
11 |
|
12 |
+
llama_model = transformers.AutoModelforCausalLM(base_model)
|
13 |
+
|
14 |
pipeline = transformers.pipeline(
|
15 |
"text-generation",
|
16 |
+
model=llama_model,
|
17 |
model_kwargs={"torch_dtype": torch.bfloat16},
|
18 |
device="cuda",
|
19 |
)
|
20 |
+
pipeline.model = PeftModel.from_pretrained(llama_model, model_id)
|
21 |
|
22 |
def chat_function(message, history, system_prompt, max_new_tokens, temperature):
|
23 |
messages = [{"role":"system","content":system_prompt},
|