|
import gradio as gr
|
|
import pandas as pd
|
|
|
|
|
|
df_overall = pd.read_csv('content/overall.csv')
|
|
df_overall_clear = pd.DataFrame([['' for i in range(11)]],columns=df_overall.columns)
|
|
df_untrained = pd.read_csv('content/untrained.csv')
|
|
df_untrained_clear = pd.DataFrame([['' for i in range(9)]],columns=df_untrained.columns)
|
|
df_trained = pd.read_csv('content/trained.csv')
|
|
df_trained_clear = pd.DataFrame([['' for i in range(9)]],columns=df_trained.columns)
|
|
|
|
def add_data(input, output):
|
|
return pd.concat([input,output])
|
|
def refresh_overall():
|
|
return df_overall
|
|
def refresh_untrained():
|
|
return df_untrained
|
|
def refresh_trained():
|
|
return df_trained
|
|
|
|
with gr.Blocks() as demo:
|
|
gr.Markdown(value="Welcome to PTBench! Here are some results of our experiments. If you want to use PTBench to test your own model, please visit [our github repo](https://github.com/hyfshadow/PTBench) for further instruction. You can enter your results and compare with these models below.", container=False)
|
|
with gr.Tab("Overall"):
|
|
output = gr.Dataframe(value=df_overall, interactive=False, show_search="search")
|
|
gr.Textbox(value="input your model's performace below and compare with other models!", container=False)
|
|
input = gr.Dataframe(value=df_overall_clear, col_count=(11,"fixed"))
|
|
btn = gr.Button("update")
|
|
btn.click(fn=add_data, inputs=[input, output], outputs=output)
|
|
btn = gr.Button("reset")
|
|
btn.click(fn=refresh_overall, inputs=None, outputs=output)
|
|
|
|
|
|
with gr.Tab("Untrained"):
|
|
output = gr.Dataframe(value=df_untrained, interactive=False, show_search="search")
|
|
gr.Textbox(value="input your model's performace below and compare with other models!", container=False)
|
|
input = gr.Dataframe(value=df_untrained_clear, col_count=(9,"fixed"))
|
|
btn = gr.Button("update")
|
|
btn.click(fn=add_data, inputs=[input, output], outputs=output)
|
|
btn = gr.Button("reset")
|
|
btn.click(fn=refresh_untrained, inputs=None, outputs=output)
|
|
|
|
with gr.Tab("Trained"):
|
|
output = gr.Dataframe(value=df_trained, interactive=False, show_search="search")
|
|
gr.Textbox(value="input your model's performace below and compare with other models!", container=False)
|
|
input = gr.Dataframe(value=df_trained_clear, col_count=(9,"fixed"))
|
|
btn = gr.Button("update")
|
|
btn.click(fn=add_data, inputs=[input, output], outputs=output)
|
|
btn = gr.Button("reset")
|
|
btn.click(fn=refresh_trained, inputs=None, outputs=output)
|
|
|
|
demo.launch() |