mrcuddle commited on
Commit
fa34d76
·
verified ·
1 Parent(s): 2b7fd8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -31,12 +31,12 @@ def chatbot(message, history):
31
  # Append the response to the history
32
  history.append((message, response))
33
  return history, ""
34
- # Create the Gradio interface
35
  with gr.Blocks() as demo:
36
  gr.Markdown("## Chatbot using Transformers")
37
 
38
  # Create a Chatbot component
39
- chatbot = gr.Chatbot([], elem_id="chatbot")
40
 
41
  with gr.Row():
42
  # Create a Textbox component for user input
@@ -46,7 +46,7 @@ with gr.Blocks() as demo:
46
  )
47
 
48
  # Attach the chatbot function to the Textbox component
49
- txt.submit(chatbot, [txt, chatbot], [chatbot, txt])
50
 
51
  # Launch the Gradio interface
52
  demo.launch()
 
31
  # Append the response to the history
32
  history.append((message, response))
33
  return history, ""
34
+ # Create the Gradio interface
35
  with gr.Blocks() as demo:
36
  gr.Markdown("## Chatbot using Transformers")
37
 
38
  # Create a Chatbot component
39
+ chatbot_component = gr.Chatbot([], elem_id="chatbot")
40
 
41
  with gr.Row():
42
  # Create a Textbox component for user input
 
46
  )
47
 
48
  # Attach the chatbot function to the Textbox component
49
+ txt.submit(chatbot, [txt, chatbot_component], [chatbot_component, txt])
50
 
51
  # Launch the Gradio interface
52
  demo.launch()