Spaces:
Sleeping
Sleeping
Commit
·
ee9bd35
1
Parent(s):
f95de96
debugging chat
Browse files
app.py
CHANGED
@@ -111,11 +111,12 @@ def infer(question, history):
|
|
111 |
# # res.append(pair)
|
112 |
|
113 |
# chat_history = res
|
|
|
114 |
result = qa({"query": question})
|
115 |
return result["result"]
|
116 |
|
117 |
def bot(history):
|
118 |
-
print("
|
119 |
response = infer(history[-1][0], history)
|
120 |
history[-1][1] = ""
|
121 |
|
@@ -125,10 +126,10 @@ def bot(history):
|
|
125 |
yield history
|
126 |
|
127 |
def add_text(history, text):
|
|
|
128 |
history = history + [(text, None)]
|
129 |
return history, ""
|
130 |
|
131 |
-
|
132 |
css="""
|
133 |
#col-container {max-width: 700px; margin-left: auto; margin-right: auto;}
|
134 |
"""
|
|
|
111 |
# # res.append(pair)
|
112 |
|
113 |
# chat_history = res
|
114 |
+
print("Question in infer :",question)
|
115 |
result = qa({"query": question})
|
116 |
return result["result"]
|
117 |
|
118 |
def bot(history):
|
119 |
+
print("history from bot: ",history[-1][0])
|
120 |
response = infer(history[-1][0], history)
|
121 |
history[-1][1] = ""
|
122 |
|
|
|
126 |
yield history
|
127 |
|
128 |
def add_text(history, text):
|
129 |
+
print("Add Text 1 history{} text{}:".format(history,text ))
|
130 |
history = history + [(text, None)]
|
131 |
return history, ""
|
132 |
|
|
|
133 |
css="""
|
134 |
#col-container {max-width: 700px; margin-left: auto; margin-right: auto;}
|
135 |
"""
|