winglian commited on
Commit
7606298
1 Parent(s): 6009bc8

move leaderboard tab to second position

Browse files
Files changed (1) hide show
  1. app.py +62 -62
app.py CHANGED
@@ -183,12 +183,6 @@ with gr.Blocks() as arena:
183
  - For now, this is single turn only
184
  - For now, Hermes 13B on the left, Manticore on the right.
185
  """)
186
- with gr.Tab("Leaderboard"):
187
- with gr.Column():
188
- gr.Markdown(f"""
189
- ### TBD
190
- - This is very much a work-in-progress, if you'd like to help build this out, join us on [Discord](https://discord.gg/QYF8QrtEUm)
191
- """)
192
  with gr.Tab("Chatbot"):
193
  with gr.Row():
194
  with gr.Column():
@@ -216,63 +210,69 @@ with gr.Blocks() as arena:
216
  with gr.Row():
217
  submit = gr.Button(value="Send message", variant="secondary").style(full_width=True)
218
  clear = gr.Button(value="New topic", variant="secondary").style(full_width=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
 
220
- clear.click(lambda: None, None, chatbot1, queue=False)
221
- clear.click(lambda: None, None, chatbot2, queue=False)
222
- clear.click(lambda: None, None, message, queue=False)
223
- clear.click(lambda: None, None, nudge_msg, queue=False)
224
-
225
- submit_click_event = submit.click(
226
- lambda *args: (
227
- gr.update(visible=False, interactive=False),
228
- gr.update(visible=False),
229
- gr.update(visible=False),
230
- ),
231
- inputs=[], outputs=[message, clear, submit], queue=True
232
- ).then(
233
- fn=user, inputs=[message, nudge_msg, chatbot1, chatbot2], outputs=[message, nudge_msg, chatbot1, chatbot2], queue=True
234
- ).then(
235
- fn=chat, inputs=[chatbot1, chatbot2, system_msg], outputs=[chatbot1, chatbot2, message], queue=True
236
- ).then(
237
- lambda *args: (
238
- gr.update(visible=False, interactive=False),
239
- gr.update(visible=True),
240
- gr.update(visible=True),
241
- gr.update(visible=False),
242
- gr.update(visible=False),
243
- ),
244
- inputs=[message, nudge_msg, system_msg], outputs=[message, choose1, choose2, clear, submit], queue=True
245
- )
246
-
247
- choose1_click_event = choose1.click(
248
- fn=chosen_one_first, inputs=[chatbot1, chatbot2, system_msg, rlhf_persona], outputs=[], queue=True
249
- ).then(
250
- lambda *args: (
251
- gr.update(visible=True, interactive=True),
252
- gr.update(visible=False),
253
- gr.update(visible=False),
254
- gr.update(visible=True),
255
- gr.update(visible=True),
256
- None,
257
- None,
258
- ),
259
- inputs=[], outputs=[message, choose1, choose2, clear, submit, chatbot1, chatbot2], queue=True
260
- )
261
-
262
- choose2_click_event = choose2.click(
263
- fn=chosen_one_second, inputs=[chatbot1, chatbot2, system_msg, rlhf_persona], outputs=[], queue=True
264
- ).then(
265
- lambda *args: (
266
- gr.update(visible=True, interactive=True),
267
- gr.update(visible=False),
268
- gr.update(visible=False),
269
- gr.update(visible=True),
270
- gr.update(visible=True),
271
- None,
272
- None,
273
- ),
274
- inputs=[], outputs=[message, choose1, choose2, clear, submit, chatbot1, chatbot2], queue=True
275
- )
276
 
277
 
278
  arena.queue(concurrency_count=2, max_size=16).launch(debug=True, server_name="0.0.0.0", server_port=7860)
 
183
  - For now, this is single turn only
184
  - For now, Hermes 13B on the left, Manticore on the right.
185
  """)
 
 
 
 
 
 
186
  with gr.Tab("Chatbot"):
187
  with gr.Row():
188
  with gr.Column():
 
210
  with gr.Row():
211
  submit = gr.Button(value="Send message", variant="secondary").style(full_width=True)
212
  clear = gr.Button(value="New topic", variant="secondary").style(full_width=False)
213
+ with gr.Tab("Leaderboard"):
214
+ with gr.Column():
215
+ gr.Markdown(f"""
216
+ ### TBD
217
+ - This is very much a work-in-progress, if you'd like to help build this out, join us on [Discord](https://discord.gg/QYF8QrtEUm)
218
+ """)
219
+
220
+ clear.click(lambda: None, None, chatbot1, queue=False)
221
+ clear.click(lambda: None, None, chatbot2, queue=False)
222
+ clear.click(lambda: None, None, message, queue=False)
223
+ clear.click(lambda: None, None, nudge_msg, queue=False)
224
+
225
+ submit_click_event = submit.click(
226
+ lambda *args: (
227
+ gr.update(visible=False, interactive=False),
228
+ gr.update(visible=False),
229
+ gr.update(visible=False),
230
+ ),
231
+ inputs=[], outputs=[message, clear, submit], queue=True
232
+ ).then(
233
+ fn=user, inputs=[message, nudge_msg, chatbot1, chatbot2], outputs=[message, nudge_msg, chatbot1, chatbot2], queue=True
234
+ ).then(
235
+ fn=chat, inputs=[chatbot1, chatbot2, system_msg], outputs=[chatbot1, chatbot2, message], queue=True
236
+ ).then(
237
+ lambda *args: (
238
+ gr.update(visible=False, interactive=False),
239
+ gr.update(visible=True),
240
+ gr.update(visible=True),
241
+ gr.update(visible=False),
242
+ gr.update(visible=False),
243
+ ),
244
+ inputs=[message, nudge_msg, system_msg], outputs=[message, choose1, choose2, clear, submit], queue=True
245
+ )
246
+
247
+ choose1_click_event = choose1.click(
248
+ fn=chosen_one_first, inputs=[chatbot1, chatbot2, system_msg, rlhf_persona], outputs=[], queue=True
249
+ ).then(
250
+ lambda *args: (
251
+ gr.update(visible=True, interactive=True),
252
+ gr.update(visible=False),
253
+ gr.update(visible=False),
254
+ gr.update(visible=True),
255
+ gr.update(visible=True),
256
+ None,
257
+ None,
258
+ ),
259
+ inputs=[], outputs=[message, choose1, choose2, clear, submit, chatbot1, chatbot2], queue=True
260
+ )
261
 
262
+ choose2_click_event = choose2.click(
263
+ fn=chosen_one_second, inputs=[chatbot1, chatbot2, system_msg, rlhf_persona], outputs=[], queue=True
264
+ ).then(
265
+ lambda *args: (
266
+ gr.update(visible=True, interactive=True),
267
+ gr.update(visible=False),
268
+ gr.update(visible=False),
269
+ gr.update(visible=True),
270
+ gr.update(visible=True),
271
+ None,
272
+ None,
273
+ ),
274
+ inputs=[], outputs=[message, choose1, choose2, clear, submit, chatbot1, chatbot2], queue=True
275
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
276
 
277
 
278
  arena.queue(concurrency_count=2, max_size=16).launch(debug=True, server_name="0.0.0.0", server_port=7860)