PawinC commited on
Commit
254fd05
·
verified ·
1 Parent(s): 85e5dc5

Update app/main.py

Browse files
Files changed (1) hide show
  1. app/main.py +1 -1
app/main.py CHANGED
@@ -32,7 +32,7 @@ def ask_llama(llm: Llama, question: str, max_new_tokens=200, temperature=0.5, re
32
  prompt = f"""<|begin_of_text|>
33
  <|start_header_id|> user <|end_header_id|> {question} <|eot_id|>
34
  <|start_header_id|> assistant <|end_header_id|>"""
35
- result = extract_restext(llm.complete(prompt, max_tokens=max_new_tokens, temperature=temperature, repeat_penalty=repeat_penalty, stop=["<|eot_id|>", "<|end_of_text|>"])).replace("<|eot_id|>", "").replace("<|end_of_text|>", "")
36
  return result
37
 
38
  # def chat_llama(llm: Llama, chat_history: dict, max_new_tokens=200, temperature=0.5, repeat_penalty=2.0):
 
32
  prompt = f"""<|begin_of_text|>
33
  <|start_header_id|> user <|end_header_id|> {question} <|eot_id|>
34
  <|start_header_id|> assistant <|end_header_id|>"""
35
+ result = extract_restext(llm(prompt, max_tokens=max_new_tokens, temperature=temperature, repeat_penalty=repeat_penalty, stop=["<|eot_id|>", "<|end_of_text|>"])).replace("<|eot_id|>", "").replace("<|end_of_text|>", "")
36
  return result
37
 
38
  # def chat_llama(llm: Llama, chat_history: dict, max_new_tokens=200, temperature=0.5, repeat_penalty=2.0):