Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -197,10 +197,10 @@ with gr.Blocks() as demo:
|
|
197 |
placeholder="Ask me something",)
|
198 |
clear = gr.Button("Delete")
|
199 |
|
200 |
-
def user(user_message, history):
|
201 |
return "", history + [[user_message, None]]
|
202 |
|
203 |
-
def bot(history):
|
204 |
user_message = history[-1][0]
|
205 |
#bot_message = chat_engine.chat(user_message)
|
206 |
bot_message = asyncio.run(query_engine.aquery(user_message + "Let's think step by step to get the correct answer. If you cannot provide an answer, say you don't know."))
|
@@ -211,7 +211,7 @@ with gr.Blocks() as demo:
|
|
211 |
yield history
|
212 |
|
213 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
214 |
-
bot, chatbot, chatbot
|
215 |
)
|
216 |
clear.click(lambda: None, None, chatbot, queue=False)
|
217 |
# demo.queue()
|
|
|
197 |
placeholder="Ask me something",)
|
198 |
clear = gr.Button("Delete")
|
199 |
|
200 |
+
async def user(user_message, history):
|
201 |
return "", history + [[user_message, None]]
|
202 |
|
203 |
+
async def bot(history):
|
204 |
user_message = history[-1][0]
|
205 |
#bot_message = chat_engine.chat(user_message)
|
206 |
bot_message = asyncio.run(query_engine.aquery(user_message + "Let's think step by step to get the correct answer. If you cannot provide an answer, say you don't know."))
|
|
|
211 |
yield history
|
212 |
|
213 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
214 |
+
await bot, chatbot, chatbot
|
215 |
)
|
216 |
clear.click(lambda: None, None, chatbot, queue=False)
|
217 |
# demo.queue()
|