piotr-szleg-bards-ai commited on
Commit
5abe76f
·
1 Parent(s): 29c05f7

2024-02-19 16:07:07 Publish script update

Browse files
Files changed (2) hide show
  1. app.py +12 -3
  2. data/output_plots.csv +0 -0
app.py CHANGED
@@ -118,7 +118,7 @@ def dataframes():
118
 
119
  def for_dataframe(df):
120
  if not searched_model_names:
121
- return df
122
  return dataframe_style(pd.concat(df[df.model.str.lower().str.contains(n)] for n in searched_model_names))
123
 
124
  return (
@@ -130,14 +130,23 @@ def dataframes():
130
 
131
  def dataframe_style(df: pd.DataFrame):
132
  df = df.copy()
133
- df.columns = [snake_case_to_title(column) for column in df.columns]
134
  column_formats = {}
 
 
135
  for column in df.columns:
136
  if is_numeric_dtype(df[column]):
137
  if column == "execution_time":
138
  column_formats[column] = "{:.4f}"
139
  else:
140
  column_formats[column] = "{:.2f}"
 
 
 
 
 
 
 
 
141
  df = df.style.format(column_formats, na_rep="")
142
  return df
143
 
@@ -196,7 +205,7 @@ def display_plot(plot_df_row):
196
  gr.Markdown(str(row["description"]))
197
 
198
 
199
- with gr.Blocks() as demo:
200
  gr.HTML("<h1>Performance LLM Board</h1>")
201
 
202
  with gr.Row():
 
118
 
119
  def for_dataframe(df):
120
  if not searched_model_names:
121
+ return dataframe_style(df)
122
  return dataframe_style(pd.concat(df[df.model.str.lower().str.contains(n)] for n in searched_model_names))
123
 
124
  return (
 
130
 
131
  def dataframe_style(df: pd.DataFrame):
132
  df = df.copy()
 
133
  column_formats = {}
134
+ new_column_names = []
135
+
136
  for column in df.columns:
137
  if is_numeric_dtype(df[column]):
138
  if column == "execution_time":
139
  column_formats[column] = "{:.4f}"
140
  else:
141
  column_formats[column] = "{:.2f}"
142
+ new_column_name = snake_case_to_title(column)
143
+ if "time" in column:
144
+ new_column_name += " (Seconds)"
145
+ elif "chunk" in column:
146
+ new_column_name += " (Characters)"
147
+ new_column_names.append(new_column_name)
148
+
149
+ df.columns = new_column_names
150
  df = df.style.format(column_formats, na_rep="")
151
  return df
152
 
 
205
  gr.Markdown(str(row["description"]))
206
 
207
 
208
+ with gr.Blocks(theme=gr.themes.Default(text_size="lg")) as demo:
209
  gr.HTML("<h1>Performance LLM Board</h1>")
210
 
211
  with gr.Row():
data/output_plots.csv CHANGED
The diff for this file is too large to render. See raw diff