Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,14 +14,15 @@ def generate_text(input_text, history):
|
|
| 14 |
print("history ",history)
|
| 15 |
print("input ", input_text)
|
| 16 |
if history == []:
|
| 17 |
-
input_text_with_history = input_text
|
| 18 |
else:
|
|
|
|
| 19 |
for i in history:
|
| 20 |
input_text_with_history += i[0] + "\n" + i[1]
|
| 21 |
input_text_with_history += f"Q: {input_text} \n A:"
|
| 22 |
|
| 23 |
print("new input", input_text_with_history)
|
| 24 |
-
output = llm(, max_tokens=1024, stop=["Q:", "\n"], echo=True)
|
| 25 |
response = output['choices'][0]['text']
|
| 26 |
return response
|
| 27 |
|
|
|
|
| 14 |
print("history ",history)
|
| 15 |
print("input ", input_text)
|
| 16 |
if history == []:
|
| 17 |
+
input_text_with_history = f"Q: {input_text} \n A:"
|
| 18 |
else:
|
| 19 |
+
input_text_with_history = ""
|
| 20 |
for i in history:
|
| 21 |
input_text_with_history += i[0] + "\n" + i[1]
|
| 22 |
input_text_with_history += f"Q: {input_text} \n A:"
|
| 23 |
|
| 24 |
print("new input", input_text_with_history)
|
| 25 |
+
output = llm(input_text_with_history, max_tokens=1024, stop=["Q:", "\n"], echo=True)
|
| 26 |
response = output['choices'][0]['text']
|
| 27 |
return response
|
| 28 |
|