File size: 953 Bytes
ed4afda
 
7d9cce6
 
ed4afda
 
7d9cce6
 
 
 
ed4afda
 
7d9cce6
 
 
 
ed4afda
7d9cce6
 
 
 
 
ed4afda
7d9cce6
 
ed4afda
7d9cce6
 
ed4afda
7d9cce6
 
ed4afda
7d9cce6
 
ed4afda
7d9cce6
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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()