Subbu1304 commited on
Commit
d6123ff
·
verified ·
1 Parent(s): 194de38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -11,7 +11,8 @@ def chatbot_response(user_input, history):
11
  bot_message += char
12
  history.append((user_input, bot_message))
13
  time.sleep(0.05) # Delay to simulate typing speed
14
- yield gr.update(value=bot_message) # Yield updated message
 
15
 
16
  # Gradio Interface Setup
17
  def create_gradio_interface():
@@ -20,8 +21,7 @@ def create_gradio_interface():
20
  gr.Markdown("Talk to the bot and customize your food preferences.")
21
 
22
  # Conversation Box
23
- with gr.Chatbot() as chatbox:
24
- pass
25
 
26
  # User input field
27
  user_input = gr.Textbox(placeholder="Type your message here...", lines=1)
 
11
  bot_message += char
12
  history.append((user_input, bot_message))
13
  time.sleep(0.05) # Delay to simulate typing speed
14
+ # Instead of yielding, update history for chatbox
15
+ yield history
16
 
17
  # Gradio Interface Setup
18
  def create_gradio_interface():
 
21
  gr.Markdown("Talk to the bot and customize your food preferences.")
22
 
23
  # Conversation Box
24
+ chatbox = gr.Chatbot()
 
25
 
26
  # User input field
27
  user_input = gr.Textbox(placeholder="Type your message here...", lines=1)