Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -100,31 +100,21 @@ def user_ask(state, chatbot1, chatbot2, textbox):
|
|
100 |
# ... [Rest of your existing functions] ...
|
101 |
|
102 |
with gr.Blocks() as demo:
|
103 |
-
state = gr.State({})
|
104 |
-
|
105 |
with gr.Row():
|
106 |
with gr.Column(scale=0.5):
|
107 |
with gr.Row() as button_row:
|
108 |
-
upvote_btn = gr.Button(value="
|
109 |
-
downvote_btn = gr.Button(value="
|
110 |
tie_btn = gr.Button(value="π€ Tie", interactive=False)
|
111 |
clear_btn = gr.Button(value="ποΈ Clear", interactive=False)
|
112 |
with gr.Column():
|
113 |
-
chatbot1 = gr.Chatbot(label='
|
114 |
-
chatbot2 = gr.Chatbot(label='
|
115 |
with gr.Row():
|
116 |
with gr.Column(scale=8):
|
117 |
-
textbox = gr.Textbox(placeholder="Enter
|
118 |
with gr.Column(scale=1, min_width=60):
|
119 |
-
submit_btn = gr.Button(value="
|
120 |
-
|
121 |
-
textbox.submit(user_ask, [state, chatbot1, chatbot2, textbox], [state, chatbot1, chatbot2, textbox])
|
122 |
-
submit_btn.click(user_ask, [state, chatbot1, chatbot2, textbox], [state, chatbot1, chatbot2, textbox])
|
123 |
-
upvote_btn.click(vote_up_model, [state, chatbot1], [chatbot1])
|
124 |
-
downvote_btn.click(vote_down_model, [state, chatbot1], [chatbot1])
|
125 |
-
clear_btn.click(lambda _: (chatbot1.clear(), chatbot2.clear()), inputs=[], outputs=[chatbot1, chatbot2])
|
126 |
|
127 |
-
demo.queue()
|
128 |
-
demo.launch(share=True, server_name='0.0.0.0', server_port=7860)
|
129 |
-
demo.queue()
|
130 |
demo.launch(share=True, server_name='0.0.0.0', server_port=7860)
|
|
|
100 |
# ... [Rest of your existing functions] ...
|
101 |
|
102 |
with gr.Blocks() as demo:
|
|
|
|
|
103 |
with gr.Row():
|
104 |
with gr.Column(scale=0.5):
|
105 |
with gr.Row() as button_row:
|
106 |
+
upvote_btn = gr.Button(value="<= Vote for A", interactive=False)
|
107 |
+
downvote_btn = gr.Button(value="=> Vote for B", interactive=False)
|
108 |
tie_btn = gr.Button(value="π€ Tie", interactive=False)
|
109 |
clear_btn = gr.Button(value="ποΈ Clear", interactive=False)
|
110 |
with gr.Column():
|
111 |
+
chatbot1 = gr.Chatbot(label='Model A')
|
112 |
+
chatbot2 = gr.Chatbot(label='Model B')
|
113 |
with gr.Row():
|
114 |
with gr.Column(scale=8):
|
115 |
+
textbox = gr.Textbox(placeholder="Enter your prompt and press ENTER")
|
116 |
with gr.Column(scale=1, min_width=60):
|
117 |
+
submit_btn = gr.Button(value="Send")
|
118 |
+
|
|
|
|
|
|
|
|
|
|
|
119 |
|
|
|
|
|
|
|
120 |
demo.launch(share=True, server_name='0.0.0.0', server_port=7860)
|