eduardo-alvarez commited on
Commit
47f3547
1 Parent(s): 6d60fea

adding hyperlinks to models

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -166,9 +166,15 @@ with demo:
166
  label="Model Types",
167
  elem_id="model_types",
168
  value=["pretrained","fine-tuned","chat-models","merges/moerges"])
169
-
 
 
 
 
 
170
  initial_df = pd.read_csv("./status/leaderboard_status_041624.csv")
171
- initial_df["Model"] = f'<a target="_blank" href="{"https://huggingface.co/"+initial_df["Model"]}">{initial_df["Model"]}</a>'
 
172
 
173
  def update_df(hw_selected, platform_selected, affiliation_selected, size_selected, precision_selected, type_selected):
174
  filtered_df = filter_benchmarks_table(df=initial_df, hw_selected=hw_selected, platform_selected=platform_selected,
@@ -176,6 +182,7 @@ with demo:
176
  precision_selected=precision_selected, type_selected=type_selected)
177
  return filtered_df
178
 
 
179
  initial_filtered_df = update_df(["Gaudi","Xeon","GPU Max","Arc GPU","Core Ultra"],
180
  ["Intel Developer Cloud","AWS","Azure","Google Cloud Platform","Local"],
181
  ["No Affiliation","Intel Innovator","Student Ambassador","Intel Liftoff", "Intel Engineering", "Other"],
@@ -183,10 +190,12 @@ with demo:
183
  ["fp32","fp16","bf16","int8","fp8", "int4"],
184
  ["pretrained","fine-tuned","chat-models","merges/moerges"])
185
 
 
186
  gradio_df_display = gr.Dataframe(value=initial_filtered_df, headers=["Model","Average","Hardware","Model Type","Precision",
187
  "Size","Infrastructure","ARC","HellaSwag","MMLU",
188
  "TruthfulQA","Winogrande","Affiliation"],
189
- datatype=["markdown","str","str","str","str","str","str","str","str","str","str","str","str"])
 
190
 
191
  filter_hw.change(fn=update_df,
192
  inputs=[filter_hw, filter_platform, filter_affiliation, filter_size, filter_precision, filter_type],
 
166
  label="Model Types",
167
  elem_id="model_types",
168
  value=["pretrained","fine-tuned","chat-models","merges/moerges"])
169
+
170
+ color = '#5750DC'
171
+ def make_clickable(row):
172
+ return f'<a href="https://huggingface.co/{row["Model"]}" target="_blank" style="color: {color}; text-decoration: underline;">{row["Model"]}</a>'
173
+
174
+
175
  initial_df = pd.read_csv("./status/leaderboard_status_041624.csv")
176
+ initial_df["Model"] = initial_df.apply(make_clickable, axis=1)
177
+
178
 
179
  def update_df(hw_selected, platform_selected, affiliation_selected, size_selected, precision_selected, type_selected):
180
  filtered_df = filter_benchmarks_table(df=initial_df, hw_selected=hw_selected, platform_selected=platform_selected,
 
182
  precision_selected=precision_selected, type_selected=type_selected)
183
  return filtered_df
184
 
185
+
186
  initial_filtered_df = update_df(["Gaudi","Xeon","GPU Max","Arc GPU","Core Ultra"],
187
  ["Intel Developer Cloud","AWS","Azure","Google Cloud Platform","Local"],
188
  ["No Affiliation","Intel Innovator","Student Ambassador","Intel Liftoff", "Intel Engineering", "Other"],
 
190
  ["fp32","fp16","bf16","int8","fp8", "int4"],
191
  ["pretrained","fine-tuned","chat-models","merges/moerges"])
192
 
193
+
194
  gradio_df_display = gr.Dataframe(value=initial_filtered_df, headers=["Model","Average","Hardware","Model Type","Precision",
195
  "Size","Infrastructure","ARC","HellaSwag","MMLU",
196
  "TruthfulQA","Winogrande","Affiliation"],
197
+ datatype=["html","str","str","str","str","str","str","str","str","str","str","str","str"],
198
+ interactive=False)
199
 
200
  filter_hw.change(fn=update_df,
201
  inputs=[filter_hw, filter_platform, filter_affiliation, filter_size, filter_precision, filter_type],