Spaces:
Runtime error
Runtime error
Commit
·
c775ff6
1
Parent(s):
9ba23bb
Add links
Browse files
app.py
CHANGED
@@ -15,6 +15,23 @@ MAIN_METRIC_PER_TASK = {
|
|
15 |
benchmark_name: "ROC_AUC"
|
16 |
}
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
def get_model_results(model_meta):
|
19 |
metrics_meta = []
|
20 |
for index in model_meta['model-index']:
|
@@ -40,7 +57,7 @@ for model in models[:10]:
|
|
40 |
model_results = get_model_results(meta)
|
41 |
|
42 |
for result in model_results:
|
43 |
-
results += [dict(model=model.modelId, **result)]
|
44 |
|
45 |
df = pd.DataFrame(results)
|
46 |
|
@@ -51,6 +68,8 @@ with block:
|
|
51 |
gr.Markdown(f"## Task - {group_name}")
|
52 |
|
53 |
group = group.sort_values(MAIN_METRIC_PER_TASK[group_name], ascending=False)
|
54 |
-
|
|
|
55 |
|
56 |
block.launch()
|
|
|
|
15 |
benchmark_name: "ROC_AUC"
|
16 |
}
|
17 |
|
18 |
+
|
19 |
+
def create_model_link(model_id, link=None, type=None):
|
20 |
+
|
21 |
+
if link is None:
|
22 |
+
type_url_part = ''
|
23 |
+
|
24 |
+
if type != 'repo':
|
25 |
+
type_url_part = type
|
26 |
+
|
27 |
+
link = f"https://huggingface.co/{type_url_part}/{model_id}"
|
28 |
+
|
29 |
+
|
30 |
+
return (
|
31 |
+
f'<a target="_blank" style="text-decoration: underline" href="{link}">{model_id}</a>'
|
32 |
+
)
|
33 |
+
|
34 |
+
|
35 |
def get_model_results(model_meta):
|
36 |
metrics_meta = []
|
37 |
for index in model_meta['model-index']:
|
|
|
57 |
model_results = get_model_results(meta)
|
58 |
|
59 |
for result in model_results:
|
60 |
+
results += [dict(model=create_model_link(model.modelId), **result)]
|
61 |
|
62 |
df = pd.DataFrame(results)
|
63 |
|
|
|
68 |
gr.Markdown(f"## Task - {group_name}")
|
69 |
|
70 |
group = group.sort_values(MAIN_METRIC_PER_TASK[group_name], ascending=False)
|
71 |
+
group['dataset'] = group['dataset'].apply(lambda x: create_model_link(x, type="dataset"))
|
72 |
+
gr.DataFrame(group.reset_index(drop=True), datatype=['markdown', 'markdown'] + ['number'] * len(group.columns))
|
73 |
|
74 |
block.launch()
|
75 |
+
|