rwitz commited on
Commit
405fa0f
β€’
1 Parent(s): cf47250

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -17
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="πŸ‘ Upvote", interactive=False)
109
- downvote_btn = gr.Button(value="πŸ‘Ž Downvote", interactive=False)
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='ChatBot 1')
114
- chatbot2 = gr.Chatbot(label='ChatBot 2')
115
  with gr.Row():
116
  with gr.Column(scale=8):
117
- textbox = gr.Textbox(placeholder="Enter text and press ENTER")
118
  with gr.Column(scale=1, min_width=60):
119
- submit_btn = gr.Button(value="Submit")
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)