eduardo-alvarez commited on
Commit
3b6529e
β€’
1 Parent(s): 85f935c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -22
app.py CHANGED
@@ -77,29 +77,12 @@ with demo:
77
  response += char
78
  yield response
79
 
80
- def clear_chat(interface):
81
- # Function to clear the chat history.
82
- # This simply returns a command to clear the chat.
83
- return "clear",
84
 
85
- with gr.Blocks():
86
- with gr.Row():
87
- message_input = gr.Textbox(label="Your message")
88
- submit_button = gr.Button("Submit")
89
- clear_button = gr.Button("Clear")
90
- chatbox = gr.Chatbot()
91
-
92
- submit_button.click(
93
- fn=get_response,
94
- inputs=message_input,
95
- outputs=chatbox
96
- )
97
-
98
- clear_button.click(
99
- fn=clear_chat,
100
- inputs=[],
101
- outputs=chatbox
102
- )
103
 
104
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
105
  with gr.TabItem("πŸ† LLM Leadeboard", elem_id="llm-benchmark-table", id=0):
 
77
  response += char
78
  yield response
79
 
80
+ with gr.Blocks() as demo:
81
+ chatbot = gr.Chatbot()
82
+ msg = gr.Textbox()
83
+ clear = gr.ClearButton([msg, chatbot])
84
 
85
+ msg.submit(get_response, [msg, chatbot], [msg, chatbot])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
 
87
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
88
  with gr.TabItem("πŸ† LLM Leadeboard", elem_id="llm-benchmark-table", id=0):