Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,13 +17,13 @@ def generate_text(input_text, 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 |
|
| 29 |
|
|
|
|
| 17 |
input_text_with_history = f"Q: {input_text} \n A:"
|
| 18 |
else:
|
| 19 |
input_text_with_history = ""
|
| 20 |
+
for i in history[-1]:
|
| 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'] + "\n"
|
| 27 |
return response
|
| 28 |
|
| 29 |
|