Spaces:
Sleeping
Sleeping
openreviewer
commited on
Commit
•
7cdd6df
1
Parent(s):
59f17be
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -157,15 +157,17 @@ def setup_interface():
|
|
157 |
return handle_vote(vote, model_identity_message_a, model_identity_message_b, paper_content)
|
158 |
|
159 |
submit_button.click(fn=review_papers, inputs=[file_input],
|
160 |
-
outputs=[review1, review2, vote, vote_button, model_identity_message, model_identity_message
|
161 |
|
162 |
-
vote_button.click(fn=handle_vote_interface, inputs=[vote, model_identity_message, model_identity_message
|
163 |
outputs=[vote_message, vote, vote_button, another_paper_button])
|
164 |
|
165 |
another_paper_button.click(fn=lambda: None, inputs=None, outputs=None, js="() => { location.reload(); }")
|
166 |
|
167 |
with gr.TabItem("Leaderboard"):
|
168 |
gr.Markdown("## Leaderboard")
|
|
|
|
|
169 |
leaderboard_html = """
|
170 |
<table style="width:100%; border: 1px solid #444; border-collapse: collapse; font-family: Arial, sans-serif; background-color: #2b2b2b;">
|
171 |
<thead>
|
@@ -234,9 +236,14 @@ def setup_interface():
|
|
234 |
</tbody>
|
235 |
</table>
|
236 |
"""
|
237 |
-
|
|
|
|
|
|
|
|
|
238 |
gr.HTML(leaderboard_html)
|
239 |
|
|
|
240 |
logging.debug("Gradio interface setup complete.")
|
241 |
return demo
|
242 |
|
|
|
157 |
return handle_vote(vote, model_identity_message_a, model_identity_message_b, paper_content)
|
158 |
|
159 |
submit_button.click(fn=review_papers, inputs=[file_input],
|
160 |
+
outputs=[review1, review2, vote, vote_button, model_identity_message, model_identity_message])
|
161 |
|
162 |
+
vote_button.click(fn=handle_vote_interface, inputs=[vote, model_identity_message, model_identity_message],
|
163 |
outputs=[vote_message, vote, vote_button, another_paper_button])
|
164 |
|
165 |
another_paper_button.click(fn=lambda: None, inputs=None, outputs=None, js="() => { location.reload(); }")
|
166 |
|
167 |
with gr.TabItem("Leaderboard"):
|
168 |
gr.Markdown("## Leaderboard")
|
169 |
+
# Fetch the leaderboard data from the database
|
170 |
+
leaderboard_data = get_leaderboard()
|
171 |
leaderboard_html = """
|
172 |
<table style="width:100%; border: 1px solid #444; border-collapse: collapse; font-family: Arial, sans-serif; background-color: #2b2b2b;">
|
173 |
<thead>
|
|
|
236 |
</tbody>
|
237 |
</table>
|
238 |
"""
|
239 |
+
leaderboard_html += """
|
240 |
+
</tbody>
|
241 |
+
</table>
|
242 |
+
"""
|
243 |
+
|
244 |
gr.HTML(leaderboard_html)
|
245 |
|
246 |
+
|
247 |
logging.debug("Gradio interface setup complete.")
|
248 |
return demo
|
249 |
|