Spaces:
Running
Running
natolambert
commited on
Commit
•
5e9e451
1
Parent(s):
b146dec
clean model names
Browse files- src/utils.py +5 -0
src/utils.py
CHANGED
@@ -7,6 +7,9 @@ import re
|
|
7 |
|
8 |
# From Open LLM Leaderboard
|
9 |
def model_hyperlink(link, model_name):
|
|
|
|
|
|
|
10 |
if model_name == "random":
|
11 |
return "random"
|
12 |
elif model_name == "Cohere March 2024":
|
@@ -17,6 +20,8 @@ def model_hyperlink(link, model_name):
|
|
17 |
return f'<a target="_blank" href="https://huggingface.co/Anthropic" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
|
18 |
elif "google" == model_name.split("/")[0]:
|
19 |
return f'<a target="_blank" href="https://huggingface.co/google" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
|
|
|
|
|
20 |
return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
|
21 |
|
22 |
def undo_hyperlink(html_string):
|
|
|
7 |
|
8 |
# From Open LLM Leaderboard
|
9 |
def model_hyperlink(link, model_name):
|
10 |
+
# if model_name is above 50 characters, return first 47 characters and "..."
|
11 |
+
if len(model_name) > 50:
|
12 |
+
model_name = model_name[:47] + "..."
|
13 |
if model_name == "random":
|
14 |
return "random"
|
15 |
elif model_name == "Cohere March 2024":
|
|
|
20 |
return f'<a target="_blank" href="https://huggingface.co/Anthropic" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
|
21 |
elif "google" == model_name.split("/")[0]:
|
22 |
return f'<a target="_blank" href="https://huggingface.co/google" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
|
23 |
+
elif "PoLL" == model_name.split("/")[0]:
|
24 |
+
return model_name
|
25 |
return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
|
26 |
|
27 |
def undo_hyperlink(html_string):
|