Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -256,7 +256,6 @@ with gr.Blocks() as demo:
|
|
256 |
with gr.Row():
|
257 |
with gr.Column(scale=5):
|
258 |
textbox = gr.Textbox(placeholder="π€ Enter your prompt (up to 200 characters)", lines=2, max_lines=5)
|
259 |
-
submit_btn = gr.Button(value="π Send")
|
260 |
with gr.Row():
|
261 |
regenerate_btn = gr.Button(value="π Regenerate")
|
262 |
reset_btn = gr.Button(value="ποΈ Reset")
|
@@ -272,6 +271,7 @@ with gr.Blocks() as demo:
|
|
272 |
|
273 |
upvote_btn_a.click(vote_up_model, inputs=[state, chatbot1, chatbot2], outputs=[chatbot1, chatbot2, upvote_btn_a, upvote_btn_b, textbox, submit_btn])
|
274 |
upvote_btn_b.click(vote_down_model, inputs=[state, chatbot1, chatbot2], outputs=[chatbot1, chatbot2, upvote_btn_a, upvote_btn_b, textbox, submit_btn])
|
|
|
275 |
|
276 |
with gr.Tab("π¬ Direct Chat"):
|
277 |
gr.Markdown("## π£οΈ Chat directly with a model!")
|
@@ -286,7 +286,6 @@ with gr.Blocks() as demo:
|
|
286 |
with gr.Column(scale=5):
|
287 |
direct_textbox = gr.Textbox(placeholder="π Enter your message", lines=2, max_lines=5)
|
288 |
with gr.Row():
|
289 |
-
direct_submit_btn = gr.Button(value="π© Send")
|
290 |
direct_regenerate_btn = gr.Button(value="π Regenerate")
|
291 |
direct_reset_btn = gr.Button(value="ποΈ Reset Chat")
|
292 |
|
@@ -297,6 +296,8 @@ with gr.Blocks() as demo:
|
|
297 |
direct_submit_btn.click(direct_chat, inputs=[model_dropdown, direct_textbox, direct_chatbot], outputs=[direct_textbox, direct_chatbot])
|
298 |
direct_reset_btn.click(reset_direct_chat, None, [direct_textbox, direct_chatbot, model_dropdown])
|
299 |
|
|
|
|
|
300 |
with gr.Tab("π Leaderboard"):
|
301 |
gr.Markdown("## π Check out the top-performing models!")
|
302 |
|
|
|
256 |
with gr.Row():
|
257 |
with gr.Column(scale=5):
|
258 |
textbox = gr.Textbox(placeholder="π€ Enter your prompt (up to 200 characters)", lines=2, max_lines=5)
|
|
|
259 |
with gr.Row():
|
260 |
regenerate_btn = gr.Button(value="π Regenerate")
|
261 |
reset_btn = gr.Button(value="ποΈ Reset")
|
|
|
271 |
|
272 |
upvote_btn_a.click(vote_up_model, inputs=[state, chatbot1, chatbot2], outputs=[chatbot1, chatbot2, upvote_btn_a, upvote_btn_b, textbox, submit_btn])
|
273 |
upvote_btn_b.click(vote_down_model, inputs=[state, chatbot1, chatbot2], outputs=[chatbot1, chatbot2, upvote_btn_a, upvote_btn_b, textbox, submit_btn])
|
274 |
+
textbox.submit(user_ask, inputs=[state, chatbot1, chatbot2, textbox], outputs=[state, chatbot1, chatbot2, textbox, upvote_btn_a, upvote_btn_b], queue=True)
|
275 |
|
276 |
with gr.Tab("π¬ Direct Chat"):
|
277 |
gr.Markdown("## π£οΈ Chat directly with a model!")
|
|
|
286 |
with gr.Column(scale=5):
|
287 |
direct_textbox = gr.Textbox(placeholder="π Enter your message", lines=2, max_lines=5)
|
288 |
with gr.Row():
|
|
|
289 |
direct_regenerate_btn = gr.Button(value="π Regenerate")
|
290 |
direct_reset_btn = gr.Button(value="ποΈ Reset Chat")
|
291 |
|
|
|
296 |
direct_submit_btn.click(direct_chat, inputs=[model_dropdown, direct_textbox, direct_chatbot], outputs=[direct_textbox, direct_chatbot])
|
297 |
direct_reset_btn.click(reset_direct_chat, None, [direct_textbox, direct_chatbot, model_dropdown])
|
298 |
|
299 |
+
direct_textbox.submit(direct_chat, inputs=[model_dropdown, direct_textbox, direct_chatbot], outputs=[direct_textbox, direct_chatbot])
|
300 |
+
|
301 |
with gr.Tab("π Leaderboard"):
|
302 |
gr.Markdown("## π Check out the top-performing models!")
|
303 |
|