Spaces:
Sleeping
Sleeping
Update app/main.py
Browse files- 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
|
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):
|