rwitz commited on
Commit
3704691
1 Parent(s): 077b9b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -196,7 +196,10 @@ with gr.Blocks() as demo:
196
  upvote_btn_a.click(vote_up_model, inputs=[state, chatbot1,chatbot2], outputs=[chatbot1,chatbot2,upvote_btn_a,upvote_btn_b,textbox,submit_btn])
197
  upvote_btn_b.click(vote_down_model, inputs=[state, chatbot1,chatbot2], outputs=[chatbot1,chatbot2,upvote_btn_a,upvote_btn_b,textbox,submit_btn])
198
  with gr.Tab("Leaderboard"):
199
- leaderboard = gr.Dataframe(refresh_leaderboard())
 
 
 
200
  refresh_btn = gr.Button("Refresh Leaderboard")
201
 
202
  # Function to refresh leaderboard
 
196
  upvote_btn_a.click(vote_up_model, inputs=[state, chatbot1,chatbot2], outputs=[chatbot1,chatbot2,upvote_btn_a,upvote_btn_b,textbox,submit_btn])
197
  upvote_btn_b.click(vote_down_model, inputs=[state, chatbot1,chatbot2], outputs=[chatbot1,chatbot2,upvote_btn_a,upvote_btn_b,textbox,submit_btn])
198
  with gr.Tab("Leaderboard"):
199
+ try:
200
+ leaderboard = gr.Dataframe(refresh_leaderboard())
201
+ except:
202
+ leaderboard=gr.Dataframe()
203
  refresh_btn = gr.Button("Refresh Leaderboard")
204
 
205
  # Function to refresh leaderboard