tolulope commited on
Commit
9741ad8
·
verified ·
1 Parent(s): 6535a3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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=base_model,
15
  model_kwargs={"torch_dtype": torch.bfloat16},
16
  device="cuda",
17
  )
18
- pipeline.model = PeftModel.from_pretrained(base_model, model_id)
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},