KlaudiaTH commited on
Commit
3cf41e9
1 Parent(s): 5b71b09

Remove plot tab from leaderboard

Browse files
Files changed (2) hide show
  1. app.py +1 -14
  2. core.py +0 -24
app.py CHANGED
@@ -104,8 +104,6 @@ with demo:
104
  id=1,
105
  ) as misc:
106
  leaderboard_table_misc = gr.Dataframe()
107
- with gr.TabItem("Plots", elem_id="llm-plot-tab", id=2) as plot:
108
- leaderboard_plot = gr.Plot(elem_id="plot")
109
  acc.select(
110
  lambda x: core.update_tab_tasks(0, x),
111
  inputs=fewshot,
@@ -133,11 +131,7 @@ with demo:
133
  [shown_tasks, search_bar, langs_bar, model_types, fewshot],
134
  leaderboard_table_misc,
135
  )
136
- getattr(comp, fn)(
137
- core.update_plot,
138
- [shown_tasks, search_bar, langs_bar, model_types, fewshot],
139
- leaderboard_plot,
140
- )
141
 
142
  gr.Blocks.load(
143
  block=demo,
@@ -153,11 +147,4 @@ with demo:
153
  outputs=leaderboard_table_misc,
154
  )
155
 
156
- gr.Blocks.load(
157
- block=demo,
158
- fn=core.update_plot,
159
- inputs=[shown_tasks, search_bar, langs_bar, model_types, fewshot],
160
- outputs=leaderboard_plot,
161
- )
162
-
163
  demo.launch()
 
104
  id=1,
105
  ) as misc:
106
  leaderboard_table_misc = gr.Dataframe()
 
 
107
  acc.select(
108
  lambda x: core.update_tab_tasks(0, x),
109
  inputs=fewshot,
 
131
  [shown_tasks, search_bar, langs_bar, model_types, fewshot],
132
  leaderboard_table_misc,
133
  )
134
+
 
 
 
 
135
 
136
  gr.Blocks.load(
137
  block=demo,
 
147
  outputs=leaderboard_table_misc,
148
  )
149
 
 
 
 
 
 
 
 
150
  demo.launch()
core.py CHANGED
@@ -126,30 +126,6 @@ def update_df(
126
  return sort_cols(df, fewshot)
127
 
128
 
129
- def make_plot(df: pd.DataFrame):
130
- df.columns = df.loc["Model_Name"]
131
- df = df.drop("Model_Name")
132
- df = df.reset_index(names="task")
133
- if len(df.columns) > 2:
134
- fig = px.line(data_frame=df, x="task", y=df.columns, markers=True, width=1200)
135
- else:
136
- fig = px.bar(data_frame=df, x="task", y=df.columns[-1], width=1200)
137
- fig.update_xaxes(type="category")
138
- return fig
139
-
140
-
141
- def update_plot(
142
- tasks: list[str],
143
- model_query: str,
144
- langs: list[str],
145
- model_types: list[str],
146
- fewshot: bool = False,
147
- ):
148
- df = update_df(tasks, model_query, langs, model_types, fewshot, False).transpose()
149
- plot = make_plot(df)
150
- return plot
151
-
152
-
153
  def fix_zeroshot(tasks: list[str | int | float], fewshot: bool = False):
154
  global TAB_STATE
155
  selected_task_type = get_selected_task_type(TAB_STATE)
 
126
  return sort_cols(df, fewshot)
127
 
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  def fix_zeroshot(tasks: list[str | int | float], fewshot: bool = False):
130
  global TAB_STATE
131
  selected_task_type = get_selected_task_type(TAB_STATE)