Spaces:
Sleeping
Sleeping
Update app/main.py
Browse files- app/main.py +1 -1
app/main.py
CHANGED
@@ -26,7 +26,7 @@ t = EnThTranslator()
|
|
26 |
e = ThEnTranslator()
|
27 |
|
28 |
def extract_restext(response, is_chat=False):
|
29 |
-
return response['choices'][0]['
|
30 |
|
31 |
def ask_llama(llm: Llama, question: str, max_new_tokens=200, temperature=0.5, repeat_penalty=2.0):
|
32 |
prompt = f"""<|begin_of_text|>
|
|
|
26 |
e = ThEnTranslator()
|
27 |
|
28 |
def extract_restext(response, is_chat=False):
|
29 |
+
return response['choices'][0]['message' if is_chat else 'text'].strip()
|
30 |
|
31 |
def ask_llama(llm: Llama, question: str, max_new_tokens=200, temperature=0.5, repeat_penalty=2.0):
|
32 |
prompt = f"""<|begin_of_text|>
|