Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Clémentine
commited on
Commit
•
4b43014
1
Parent(s):
aacbe7f
now intersection of leaderboards
Browse files- app.py +21 -6
- src/static/display.py +1 -1
app.py
CHANGED
@@ -18,24 +18,39 @@ def update_leaderboards(show_all, modality_tags, submission_tags, test_set_tags,
|
|
18 |
if show_all:
|
19 |
spaces_of_interest = INFO_TO_LEADERBOARDS["all"]
|
20 |
else:
|
|
|
21 |
for tag in modality_tags:
|
22 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["modality"][tag.lower()])
|
|
|
23 |
for tag in submission_tags:
|
24 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["submission"][tag.lower()])
|
|
|
25 |
for tag in test_set_tags:
|
26 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["test"][tag.lower()])
|
|
|
27 |
for tag in evaluation_tags:
|
28 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["eval"][tag.lower()])
|
|
|
29 |
for tag in language_tags:
|
30 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["language"][tag.lower()])
|
|
|
31 |
for tag in judge_tags:
|
32 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["judge"][tag.lower()])
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
for space in spaces_of_interest
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
|
41 |
|
|
|
18 |
if show_all:
|
19 |
spaces_of_interest = INFO_TO_LEADERBOARDS["all"]
|
20 |
else:
|
21 |
+
number_of_tag_types = 0
|
22 |
for tag in modality_tags:
|
23 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["modality"][tag.lower()])
|
24 |
+
number_of_tag_types += 1
|
25 |
for tag in submission_tags:
|
26 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["submission"][tag.lower()])
|
27 |
+
number_of_tag_types += 1
|
28 |
for tag in test_set_tags:
|
29 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["test"][tag.lower()])
|
30 |
+
number_of_tag_types += 1
|
31 |
for tag in evaluation_tags:
|
32 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["eval"][tag.lower()])
|
33 |
+
number_of_tag_types += 1
|
34 |
for tag in language_tags:
|
35 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["language"][tag.lower()])
|
36 |
+
number_of_tag_types += 1
|
37 |
for tag in judge_tags:
|
38 |
spaces_of_interest.extend(INFO_TO_LEADERBOARDS["judge"][tag.lower()])
|
39 |
+
number_of_tag_types += 1
|
40 |
+
|
41 |
+
if number_of_tag_types > 1:
|
42 |
+
# Intersection of tag types
|
43 |
+
spaces_of_interest = [space for space in spaces_of_interest if spaces_of_interest.count(space) > 1]
|
44 |
+
|
45 |
+
spaces_of_interest = sorted(list(set(spaces_of_interest)))
|
46 |
+
|
47 |
+
return "\n".join(
|
48 |
+
[
|
49 |
+
make_clickable(space) +
|
50 |
+
f"*Tags: {', '.join(LEADERBOARDS_TO_INFO[space]) if len(LEADERBOARDS_TO_INFO[space]) > 0 else 'None. Please fill the tags!'}*"
|
51 |
+
for space in sorted(spaces_of_interest)
|
52 |
+
]
|
53 |
+
)
|
54 |
|
55 |
|
56 |
|
src/static/display.py
CHANGED
@@ -19,4 +19,4 @@ def model_hyperlink(link, model_name):
|
|
19 |
def make_clickable(space):
|
20 |
link = f"https://huggingface.co/spaces/{space}"
|
21 |
|
22 |
-
return model_hyperlink(link, space)
|
|
|
19 |
def make_clickable(space):
|
20 |
link = f"https://huggingface.co/spaces/{space}"
|
21 |
|
22 |
+
return "- " + model_hyperlink(link, space)
|