Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
pminervini
commited on
Commit
•
9e0eb47
1
Parent(s):
0b743c4
update
Browse files
src/backend/manage_requests.py
CHANGED
@@ -61,7 +61,7 @@ def set_eval_request(api: HfApi, eval_request: EvalRequest, set_to_status: str,
|
|
61 |
repo_id=hf_repo, repo_type="dataset")
|
62 |
|
63 |
|
64 |
-
def get_eval_requests(job_status: list, local_dir: str, hf_repo: str) -> list[EvalRequest]:
|
65 |
"""Get all pending evaluation requests and return a list in which private
|
66 |
models appearing first, followed by public models sorted by the number of
|
67 |
likes.
|
@@ -69,7 +69,9 @@ def get_eval_requests(job_status: list, local_dir: str, hf_repo: str) -> list[Ev
|
|
69 |
Returns:
|
70 |
`list[EvalRequest]`: a list of model info dicts.
|
71 |
"""
|
72 |
-
|
|
|
|
|
73 |
json_files = glob.glob(f"{local_dir}/**/*.json", recursive=True)
|
74 |
|
75 |
eval_requests = []
|
|
|
61 |
repo_id=hf_repo, repo_type="dataset")
|
62 |
|
63 |
|
64 |
+
def get_eval_requests(job_status: list, local_dir: str, hf_repo: str, do_download: bool = True) -> list[EvalRequest]:
|
65 |
"""Get all pending evaluation requests and return a list in which private
|
66 |
models appearing first, followed by public models sorted by the number of
|
67 |
likes.
|
|
|
69 |
Returns:
|
70 |
`list[EvalRequest]`: a list of model info dicts.
|
71 |
"""
|
72 |
+
if do_download:
|
73 |
+
my_snapshot_download(repo_id=hf_repo, revision="main", local_dir=local_dir, repo_type="dataset", max_workers=60)
|
74 |
+
|
75 |
json_files = glob.glob(f"{local_dir}/**/*.json", recursive=True)
|
76 |
|
77 |
eval_requests = []
|