Hieucyber2208 commited on
Commit
34fc016
·
verified ·
1 Parent(s): 6706fac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -1,13 +1,13 @@
1
  import gradio as gr
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"
11
  if retrieved_docs:
12
  for doc in retrieved_docs:
13
  bot_response += (
@@ -22,10 +22,10 @@ chat_history = []
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()
 
1
  import gradio as gr
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"
11
  if retrieved_docs:
12
  for doc in retrieved_docs:
13
  bot_response += (
 
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()