Spaces:
Running
Running
Commit
·
bf62ebb
1
Parent(s):
b106d46
"LOL"
Browse files
app.py
CHANGED
@@ -2,8 +2,9 @@ import gradio as gr
|
|
2 |
from src.chatbot import RestaurantChatbot
|
3 |
|
4 |
chatbot = RestaurantChatbot()
|
|
|
5 |
|
6 |
-
def respond(user_message, history
|
7 |
response, retrieved_docs = chatbot.answer(user_message)
|
8 |
|
9 |
bot_response = f"{response}\n\n**Nhà hàng gợi ý:**\n"
|
@@ -21,11 +22,10 @@ def respond(user_message, history: list):
|
|
21 |
else:
|
22 |
bot_response += "- Không tìm thấy nhà hàng phù hợp."
|
23 |
|
24 |
-
|
25 |
-
return history, history
|
26 |
|
27 |
with gr.Blocks() as demo:
|
28 |
gr.Markdown("## Chatbot Gợi ý Quán ăn")
|
29 |
-
|
30 |
|
31 |
demo.launch()
|
|
|
2 |
from src.chatbot import RestaurantChatbot
|
3 |
|
4 |
chatbot = RestaurantChatbot()
|
5 |
+
chat_history = []
|
6 |
|
7 |
+
def respond(user_message, history):
|
8 |
response, retrieved_docs = chatbot.answer(user_message)
|
9 |
|
10 |
bot_response = f"{response}\n\n**Nhà hàng gợi ý:**\n"
|
|
|
22 |
else:
|
23 |
bot_response += "- Không tìm thấy nhà hàng phù hợp."
|
24 |
|
25 |
+
return bot_response
|
|
|
26 |
|
27 |
with gr.Blocks() as demo:
|
28 |
gr.Markdown("## Chatbot Gợi ý Quán ăn")
|
29 |
+
chatbot_ui = gr.ChatInterface(fn=respond, chatbot=gr.Chatbot())
|
30 |
|
31 |
demo.launch()
|