Use the query URL helper
Browse files- functions.py +6 -6
functions.py
CHANGED
@@ -125,17 +125,18 @@ def calculate_results(repo: str, pool: urllib3.PoolManager):
|
|
125 |
return None
|
126 |
|
127 |
|
128 |
-
def get_details_url(repo):
|
129 |
author, model = repo.split("/")
|
130 |
return f"https://huggingface.co/datasets/open-llm-leaderboard/{author}__{model}-details"
|
131 |
|
132 |
|
133 |
-
def get_contents_url(repo):
|
134 |
return f"https://huggingface.co/datasets/open-llm-leaderboard/contents/viewer/default/train?q={repo}"
|
135 |
|
136 |
|
137 |
-
def get_query_url(repo):
|
138 |
-
|
|
|
139 |
|
140 |
|
141 |
def get_task_summary(results):
|
@@ -222,13 +223,12 @@ Summarized results can be found [here]({get_contents_url(repo)})!
|
|
222 |
|
223 |
def get_edited_yaml_readme(repo: str, results: dict, token: str | None):
|
224 |
card = ModelCard.load(repo, token=token)
|
225 |
-
param = quote(repo, safe="")
|
226 |
|
227 |
common = {
|
228 |
"task_type": "text-generation",
|
229 |
"task_name": "Text Generation",
|
230 |
"source_name": "Open LLM Leaderboard",
|
231 |
-
"source_url":
|
232 |
}
|
233 |
|
234 |
tasks_results = get_task_summary(results)
|
|
|
125 |
return None
|
126 |
|
127 |
|
128 |
+
def get_details_url(repo: str):
|
129 |
author, model = repo.split("/")
|
130 |
return f"https://huggingface.co/datasets/open-llm-leaderboard/{author}__{model}-details"
|
131 |
|
132 |
|
133 |
+
def get_contents_url(repo: str):
|
134 |
return f"https://huggingface.co/datasets/open-llm-leaderboard/contents/viewer/default/train?q={repo}"
|
135 |
|
136 |
|
137 |
+
def get_query_url(repo: str):
|
138 |
+
param = quote(repo, safe="")
|
139 |
+
return f"https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard#/?search={param}"
|
140 |
|
141 |
|
142 |
def get_task_summary(results):
|
|
|
223 |
|
224 |
def get_edited_yaml_readme(repo: str, results: dict, token: str | None):
|
225 |
card = ModelCard.load(repo, token=token)
|
|
|
226 |
|
227 |
common = {
|
228 |
"task_type": "text-generation",
|
229 |
"task_name": "Text Generation",
|
230 |
"source_name": "Open LLM Leaderboard",
|
231 |
+
"source_url": get_query_url(repo),
|
232 |
}
|
233 |
|
234 |
tasks_results = get_task_summary(results)
|