Spaces:
Running
Running
Joschka Strueber
commited on
Commit
·
228927e
1
Parent(s):
cdeeed6
[Fix] load models from leaderboard
Browse files- src/dataloading.py +5 -5
src/dataloading.py
CHANGED
@@ -6,17 +6,17 @@ def get_leaderboard_models():
|
|
6 |
api = HfApi()
|
7 |
|
8 |
# List all files in the "open_llm_leaderboard" directory of the Space
|
9 |
-
files = api.
|
10 |
repo_id="open-llm-leaderboard/open_llm_leaderboard",
|
11 |
-
|
12 |
-
|
13 |
)
|
14 |
|
15 |
models = []
|
16 |
for file in files:
|
17 |
-
if "-details" in file
|
18 |
# Extract provider and model name from filename
|
19 |
-
filename = file.
|
20 |
provider, model = filename.split("__", 1)
|
21 |
models.append(f"{provider}/{model}")
|
22 |
|
|
|
6 |
api = HfApi()
|
7 |
|
8 |
# List all files in the "open_llm_leaderboard" directory of the Space
|
9 |
+
files = api.list_repo_files(
|
10 |
repo_id="open-llm-leaderboard/open_llm_leaderboard",
|
11 |
+
repo_type="space",
|
12 |
+
path="open_llm_leaderboard"
|
13 |
)
|
14 |
|
15 |
models = []
|
16 |
for file in files:
|
17 |
+
if "-details" in file and "__" in file:
|
18 |
# Extract provider and model name from filename
|
19 |
+
filename = file.split("/")[-1].replace("-details", "")
|
20 |
provider, model = filename.split("__", 1)
|
21 |
models.append(f"{provider}/{model}")
|
22 |
|