osanseviero commited on
Commit
e0e2e23
·
1 Parent(s): 253db97

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -1
app.py CHANGED
@@ -232,4 +232,28 @@ def reload_leaderboard(rl_env):
232
 
233
  markdown = get_info_display(len(data_dataframe),rl_env, DETAILS[rl_env]['title'],is_empty)
234
 
235
- return markdown,data_html
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
 
233
  markdown = get_info_display(len(data_dataframe),rl_env, DETAILS[rl_env]['title'],is_empty)
234
 
235
+ return markdown,data_html
236
+
237
+ block = gr.Blocks(css=BLOCK_CSS)
238
+ with block:
239
+ notification = gr.HTML("""<div style="color: green">
240
+ <p> ⌛ Updating leaderboard... </p>
241
+ </div>
242
+ """)
243
+ block.load(reload_all_data,[],[notification])
244
+
245
+ with gr.Tabs():
246
+ for rl_env in ASSIGNMENTS:
247
+ with gr.TabItem(rl_env) as rl_tab:
248
+ data_html,data_dataframe,is_empty = DETAILS[rl_env]['data']
249
+ markdown = get_info_display(len(data_dataframe),rl_env,RL_DETAILS[rl_env]['title'],is_empty)
250
+ env_state =gr.Variable(default_value=rl_env)
251
+ output_markdown = gr.HTML(markdown)
252
+ reload = gr.Button('Reload Leaderboard')
253
+
254
+ output_html = gr.HTML(data_html)
255
+
256
+ reload.click(reload_leaderboard,inputs=[env_state],outputs=[output_markdown,output_html])
257
+ rl_tab.select(reload_leaderboard,inputs=[env_state],outputs=[output_markdown,output_html])
258
+
259
+ block.launch()