Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,13 @@ def bot(history):
|
|
41 |
|
42 |
def infer(question, history):
|
43 |
print(history[-1])
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
query = question
|
46 |
result = qa({"question": query, "chat_history": chat_history})
|
47 |
print(result)
|
|
|
41 |
|
42 |
def infer(question, history):
|
43 |
print(history[-1])
|
44 |
+
|
45 |
+
res = []
|
46 |
+
for human, ai in history:
|
47 |
+
res.append(f"Human:{human}\nAI:{ai}")
|
48 |
+
"\n".join(res)
|
49 |
+
chat_history = res
|
50 |
+
print(chat_history)
|
51 |
query = question
|
52 |
result = qa({"question": query, "chat_history": chat_history})
|
53 |
print(result)
|