VhixCore commited on
Commit
72c0a6b
Β·
verified Β·
1 Parent(s): 444ab46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -63,11 +63,12 @@ with gr.Blocks(css=CSS, theme=gr.themes.Default()) as app:
63
  text_input = gr.Textbox(placeholder="Speak or type your query...")
64
  submit_btn = gr.Button("⚑ Transmit", variant="primary")
65
 
 
66
  submit_btn.click(
67
- lambda msg: (generate_response(msg),
68
- inputs=[text_input],
69
- outputs=[chatbot]
70
  )
71
- )
72
  if __name__ == "__main__":
73
- app.launch(server_name="0.0.0.0", share=True)
 
63
  text_input = gr.Textbox(placeholder="Speak or type your query...")
64
  submit_btn = gr.Button("⚑ Transmit", variant="primary")
65
 
66
+ # Fixed click handler
67
  submit_btn.click(
68
+ fn=lambda msg, hist: ((msg, generate_response(msg)), hist + [(msg, generate_response(msg))]),
69
+ inputs=[text_input, chatbot],
70
+ outputs=[text_input, chatbot]
71
  )
72
+
73
  if __name__ == "__main__":
74
+ app.launch()