SreejithSHR commited on
Commit
9d1fc47
·
verified ·
1 Parent(s): 1500004

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -45,11 +45,8 @@ def add_message(history, message):
45
 
46
  def bot(history):
47
  response = "**That's cool!**"
48
- history[-1][1] = ""
49
- for character in response:
50
- history[-1][1] += character
51
- time.sleep(0.05)
52
- yield history
53
 
54
  custom_css = """
55
  .gradio-container {
@@ -94,7 +91,7 @@ with gr.Blocks(analytics_enabled=False, css=custom_css) as demo:
94
 
95
  chat_msg = chat_input.submit(add_message, [chatbot], [chatbot])
96
  bot_msg = chat_msg.then(bot, chatbot)
97
- bot_msg.then(lambda: gr.MultimodalTextbox(interactive=True), None)
98
 
99
  user_message = gr.Textbox(lines=1, placeholder="Ask anything...", label="Input", show_label=False)
100
  submit_button = gr.Button("Submit")
 
45
 
46
  def bot(history):
47
  response = "**That's cool!**"
48
+ history[-1][1] = response
49
+ return history
 
 
 
50
 
51
  custom_css = """
52
  .gradio-container {
 
91
 
92
  chat_msg = chat_input.submit(add_message, [chatbot], [chatbot])
93
  bot_msg = chat_msg.then(bot, chatbot)
94
+ bot_msg.then(lambda x: gr.MultimodalTextbox(interactive=False, value=x[-1][1]), None)
95
 
96
  user_message = gr.Textbox(lines=1, placeholder="Ask anything...", label="Input", show_label=False)
97
  submit_button = gr.Button("Submit")