Abhishek Thakur
commited on
Commit
·
8b9e4a8
1
Parent(s):
1873be0
use select
Browse files
competitions/competitions.py
CHANGED
|
@@ -25,7 +25,6 @@ submissions = Submissions(
|
|
| 25 |
autotrain_backend_api=AUTOTRAIN_BACKEND_API,
|
| 26 |
)
|
| 27 |
|
| 28 |
-
|
| 29 |
with gr.Blocks() as demo:
|
| 30 |
with gr.Tabs() as tab_container:
|
| 31 |
with gr.TabItem("Overview", id="overview"):
|
|
@@ -34,16 +33,16 @@ with gr.Blocks() as demo:
|
|
| 34 |
gr.Markdown("## Dataset")
|
| 35 |
gr.Markdown(f"{competition_info.dataset_description}")
|
| 36 |
with gr.TabItem("Public Leaderboard", id="public_leaderboard") as public_leaderboard:
|
| 37 |
-
fetch_lb = gr.Button("Fetch Leaderboard")
|
| 38 |
-
|
| 39 |
-
fetch_lb_partial = partial(leaderboard.fetch, private=False)
|
| 40 |
-
fetch_lb.click(fn=fetch_lb_partial, outputs=[
|
| 41 |
with gr.TabItem("Private Leaderboard", id="private_leaderboard"):
|
| 42 |
current_date_time = datetime.now()
|
| 43 |
if current_date_time >= competition_info.end_date:
|
| 44 |
-
|
| 45 |
fetch_lb_partial = partial(leaderboard.fetch, private=True)
|
| 46 |
-
fetch_lb_partial(outputs=[
|
| 47 |
else:
|
| 48 |
gr.Markdown("Private Leaderboard will be available after the competition ends")
|
| 49 |
with gr.TabItem("New Submission", id="new_submission"):
|
|
@@ -68,3 +67,6 @@ with gr.Blocks() as demo:
|
|
| 68 |
inputs=[user_token],
|
| 69 |
outputs=[output_text, output_df],
|
| 70 |
)
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
autotrain_backend_api=AUTOTRAIN_BACKEND_API,
|
| 26 |
)
|
| 27 |
|
|
|
|
| 28 |
with gr.Blocks() as demo:
|
| 29 |
with gr.Tabs() as tab_container:
|
| 30 |
with gr.TabItem("Overview", id="overview"):
|
|
|
|
| 33 |
gr.Markdown("## Dataset")
|
| 34 |
gr.Markdown(f"{competition_info.dataset_description}")
|
| 35 |
with gr.TabItem("Public Leaderboard", id="public_leaderboard") as public_leaderboard:
|
| 36 |
+
# fetch_lb = gr.Button("Fetch Leaderboard")
|
| 37 |
+
output_df_public = gr.DataFrame()
|
| 38 |
+
# fetch_lb_partial = partial(leaderboard.fetch, private=False)
|
| 39 |
+
# fetch_lb.click(fn=fetch_lb_partial, outputs=[output_df])
|
| 40 |
with gr.TabItem("Private Leaderboard", id="private_leaderboard"):
|
| 41 |
current_date_time = datetime.now()
|
| 42 |
if current_date_time >= competition_info.end_date:
|
| 43 |
+
output_df = gr.DataFrame()
|
| 44 |
fetch_lb_partial = partial(leaderboard.fetch, private=True)
|
| 45 |
+
fetch_lb_partial(outputs=[output_df])
|
| 46 |
else:
|
| 47 |
gr.Markdown("Private Leaderboard will be available after the competition ends")
|
| 48 |
with gr.TabItem("New Submission", id="new_submission"):
|
|
|
|
| 67 |
inputs=[user_token],
|
| 68 |
outputs=[output_text, output_df],
|
| 69 |
)
|
| 70 |
+
|
| 71 |
+
fetch_lb_partial = partial(leaderboard.fetch, private=False)
|
| 72 |
+
public_leaderboard.select(fetch_lb_partial, inputs=[], outputs=[output_df_public])
|