|
import gradio as gr |
|
|
|
from leaderboard.dataset import load_or_initialize_leaderboard |
|
from leaderboard.submission import submit_model |
|
|
|
|
|
|
|
def display_leaderboard(): |
|
dataset = load_or_initialize_leaderboard() |
|
return dataset.to_pandas() |
|
|
|
|
|
|
|
leaderboard_component = gr.DataFrame( |
|
display_leaderboard, headers=["Model Name", "Score", "Rank"], interactive=False, label="Leaderboard" |
|
) |
|
|
|
submit_form = gr.Interface( |
|
submit_model, |
|
inputs=[gr.Textbox(label="Model Name"), gr.File(label="Model File")], |
|
outputs=gr.DataFrame(headers=["Model Name", "Score", "Rank"], interactive=False), |
|
) |
|
|
|
|
|
app = gr.Blocks() |
|
|
|
with app: |
|
gr.Markdown("# human_methylation_bench_ver1") |
|
|
|
with gr.Tab("Leaderboard"): |
|
leaderboard_component.render() |
|
|
|
with gr.Tab("Submit Model"): |
|
submit_form.render() |
|
|
|
if __name__ == "__main__": |
|
app.launch() |
|
|