Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,9 +16,12 @@ def generate_text(input_text, history):
|
|
| 16 |
if history == []:
|
| 17 |
input_text_with_history = input_text
|
| 18 |
else:
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
| 20 |
print("new input", input_text_with_history)
|
| 21 |
-
output = llm(
|
| 22 |
response = output['choices'][0]['text']
|
| 23 |
return response
|
| 24 |
|
|
|
|
| 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 |
|