taxfree_python
Rebuild the project
7d9cce6
raw
history blame
953 Bytes
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()
# Gradio のコンポーネント
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),
)
# Gradio アプリケーション
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()