黄济民 commited on
Commit
25c9e40
1 Parent(s): a79e05b

feature: add auto evaluation tab

Browse files
Files changed (1) hide show
  1. app.py +12 -17
app.py CHANGED
@@ -71,27 +71,22 @@ def create_leaderboard_table(df, headers, types):
71
  max_rows=10,
72
  )
73
 
74
- def dummy_fn():
75
- pass
76
-
77
  def launch_gradio():
78
- iface = gr.Interface(
79
- fn=dummy_fn,
80
- layout="tab",
81
- inputs=None,
82
- outputs=None,
83
- title=TITLE,
84
- description=INTRODUCTION_TEXT,
85
- tabs=["Self-hosted evaluation", "Automatic evaluation"],
86
- )
87
 
88
- with iface.tab("Self-hosted evaluation"):
89
- create_leaderboard_table(leaderboard_df, COLS, TYPES)
 
90
 
91
- with iface.tab("Automatic evaluation"):
92
- create_leaderboard_table(leaderboard_auto_df, COLS_AUTO, TYPES_AUTO)
 
 
 
 
 
93
 
94
- iface.launch()
95
 
96
  scheduler = BackgroundScheduler()
97
  scheduler.add_job(launch_gradio, "interval", seconds=3600)
 
71
  max_rows=10,
72
  )
73
 
 
 
 
74
  def launch_gradio():
75
+ demo = gr.Blocks()
 
 
 
 
 
 
 
 
76
 
77
+ with demo:
78
+ gr.HTML(TITLE)
79
+ gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
80
 
81
+ # Create tabs for self-hosted and automatic evaluation
82
+ gr.Tabs(
83
+ [
84
+ {"label": "Self-hosted evaluation", "content": create_leaderboard_table(leaderboard_df, COLS, TYPES)},
85
+ {"label": "Automatic evaluation", "content": create_leaderboard_table(leaderboard_auto_df, COLS_AUTO, TYPES_AUTO)},
86
+ ]
87
+ )
88
 
89
+ demo.launch()
90
 
91
  scheduler = BackgroundScheduler()
92
  scheduler.add_job(launch_gradio, "interval", seconds=3600)