MohamedRashad commited on
Commit
f5c6d2d
·
verified ·
1 Parent(s): 36ff792

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -83,7 +83,7 @@ for model_name in tqdm(initial_list_of_models):
83
  df = df._append(benchmark_data, ignore_index=True)
84
 
85
  # Sort the dataframe by the number of tokens
86
- df = df.sort_values(by=" Total Number of Tokens", ascending=True)
87
 
88
  # Save the dataframe to a csv file
89
  df.to_json(dataframe_path, lines=True, orient="records", force_ascii=False)
@@ -210,9 +210,9 @@ def refresh():
210
  global df
211
  df = pd.read_json(dataframe_path, lines=True)
212
  return (
213
- gr.Dataframe(df),
214
- gr.BarPlot(df),
215
- gr.Dropdown(choices=df["📛 Models"].tolist()),
216
  )
217
 
218
  leaderboard_description = """The `Total Number of Tokens` in this leaderboard is based on the total number of tokens got from the Arabic section of [rasaif-translations](https://huggingface.co/datasets/MohamedRashad/rasaif-translations) dataset (This dataset was chosen because it represents Arabic Fusha text in a small and concentrated manner).
@@ -240,7 +240,7 @@ with gr.Blocks() as demo:
240
  barplot = gr.BarPlot(
241
  df,
242
  x="📛 Models",
243
- y=" Total Number of Tokens",
244
  x_title=" ",
245
  y_title=" ",
246
  width=1000,
@@ -248,6 +248,7 @@ with gr.Blocks() as demo:
248
  tooltip=["📘 Vocab Size", "🪺 Fertility Score"],
249
  vertical=False,
250
  x_label_angle=30,
 
251
  )
252
  model_name = gr.Textbox(
253
  label="Model Name from Hugging Face (e.g. Xenova/gpt-4o)"
 
83
  df = df._append(benchmark_data, ignore_index=True)
84
 
85
  # Sort the dataframe by the number of tokens
86
+ df = df.sort_values(by="🪺 Fertility Score", ascending=True)
87
 
88
  # Save the dataframe to a csv file
89
  df.to_json(dataframe_path, lines=True, orient="records", force_ascii=False)
 
210
  global df
211
  df = pd.read_json(dataframe_path, lines=True)
212
  return (
213
+ gr.update(df),
214
+ gr.update(df),
215
+ gr.update(choices=df["📛 Models"].tolist()),
216
  )
217
 
218
  leaderboard_description = """The `Total Number of Tokens` in this leaderboard is based on the total number of tokens got from the Arabic section of [rasaif-translations](https://huggingface.co/datasets/MohamedRashad/rasaif-translations) dataset (This dataset was chosen because it represents Arabic Fusha text in a small and concentrated manner).
 
240
  barplot = gr.BarPlot(
241
  df,
242
  x="📛 Models",
243
+ y="🪺 Fertility Score",
244
  x_title=" ",
245
  y_title=" ",
246
  width=1000,
 
248
  tooltip=["📘 Vocab Size", "🪺 Fertility Score"],
249
  vertical=False,
250
  x_label_angle=30,
251
+ label="Models Fertility Score (Lower is better)",
252
  )
253
  model_name = gr.Textbox(
254
  label="Model Name from Hugging Face (e.g. Xenova/gpt-4o)"