Spaces:
Runtime error
Runtime error
pminervini
commited on
Commit
•
3431666
1
Parent(s):
45d14f4
update
Browse files- backend-cli.py +5 -0
backend-cli.py
CHANGED
@@ -86,6 +86,7 @@ def process_evaluation(task: Task, eval_request: EvalRequest) -> dict:
|
|
86 |
with open(output_path, "w") as f:
|
87 |
f.write(dumped)
|
88 |
|
|
|
89 |
API.upload_file(path_or_fileobj=output_path, path_in_repo=f"{eval_request.model}/results_{datetime.now()}.json",
|
90 |
repo_id=RESULTS_REPO, repo_type="dataset")
|
91 |
return results
|
@@ -129,11 +130,13 @@ def process_finished_requests() -> bool:
|
|
129 |
if eval_result is None or task_name not in eval_result.results:
|
130 |
eval_request: EvalRequest = result_name_to_request[result_name]
|
131 |
|
|
|
132 |
set_eval_request(api=API, eval_request=eval_request, set_to_status=RUNNING_STATUS, hf_repo=QUEUE_REPO,
|
133 |
local_dir=EVAL_REQUESTS_PATH_BACKEND)
|
134 |
|
135 |
results = process_evaluation(task, eval_request)
|
136 |
|
|
|
137 |
set_eval_request(api=API, eval_request=eval_request, set_to_status=FINISHED_STATUS, hf_repo=QUEUE_REPO,
|
138 |
local_dir=EVAL_REQUESTS_PATH_BACKEND)
|
139 |
|
@@ -162,6 +165,7 @@ def process_pending_requests() -> bool:
|
|
162 |
eval_request = eval_requests[0]
|
163 |
pp.pprint(eval_request)
|
164 |
|
|
|
165 |
set_eval_request(api=API, eval_request=eval_request, set_to_status=RUNNING_STATUS, hf_repo=QUEUE_REPO,
|
166 |
local_dir=EVAL_REQUESTS_PATH_BACKEND)
|
167 |
|
@@ -171,6 +175,7 @@ def process_pending_requests() -> bool:
|
|
171 |
for task in task_lst:
|
172 |
results = process_evaluation(task, eval_request)
|
173 |
|
|
|
174 |
set_eval_request(api=API, eval_request=eval_request, set_to_status=FINISHED_STATUS, hf_repo=QUEUE_REPO,
|
175 |
local_dir=EVAL_REQUESTS_PATH_BACKEND)
|
176 |
|
|
|
86 |
with open(output_path, "w") as f:
|
87 |
f.write(dumped)
|
88 |
|
89 |
+
snapshot_download(repo_id=RESULTS_REPO, revision="main", local_dir=EVAL_RESULTS_PATH_BACKEND, repo_type="dataset", max_workers=60)
|
90 |
API.upload_file(path_or_fileobj=output_path, path_in_repo=f"{eval_request.model}/results_{datetime.now()}.json",
|
91 |
repo_id=RESULTS_REPO, repo_type="dataset")
|
92 |
return results
|
|
|
130 |
if eval_result is None or task_name not in eval_result.results:
|
131 |
eval_request: EvalRequest = result_name_to_request[result_name]
|
132 |
|
133 |
+
snapshot_download(repo_id=QUEUE_REPO, revision="main", local_dir=EVAL_REQUESTS_PATH_BACKEND, repo_type="dataset", max_workers=60)
|
134 |
set_eval_request(api=API, eval_request=eval_request, set_to_status=RUNNING_STATUS, hf_repo=QUEUE_REPO,
|
135 |
local_dir=EVAL_REQUESTS_PATH_BACKEND)
|
136 |
|
137 |
results = process_evaluation(task, eval_request)
|
138 |
|
139 |
+
snapshot_download(repo_id=QUEUE_REPO, revision="main", local_dir=EVAL_REQUESTS_PATH_BACKEND, repo_type="dataset", max_workers=60)
|
140 |
set_eval_request(api=API, eval_request=eval_request, set_to_status=FINISHED_STATUS, hf_repo=QUEUE_REPO,
|
141 |
local_dir=EVAL_REQUESTS_PATH_BACKEND)
|
142 |
|
|
|
165 |
eval_request = eval_requests[0]
|
166 |
pp.pprint(eval_request)
|
167 |
|
168 |
+
snapshot_download(repo_id=QUEUE_REPO, revision="main", local_dir=EVAL_REQUESTS_PATH_BACKEND, repo_type="dataset", max_workers=60)
|
169 |
set_eval_request(api=API, eval_request=eval_request, set_to_status=RUNNING_STATUS, hf_repo=QUEUE_REPO,
|
170 |
local_dir=EVAL_REQUESTS_PATH_BACKEND)
|
171 |
|
|
|
175 |
for task in task_lst:
|
176 |
results = process_evaluation(task, eval_request)
|
177 |
|
178 |
+
snapshot_download(repo_id=QUEUE_REPO, revision="main", local_dir=EVAL_REQUESTS_PATH_BACKEND, repo_type="dataset", max_workers=60)
|
179 |
set_eval_request(api=API, eval_request=eval_request, set_to_status=FINISHED_STATUS, hf_repo=QUEUE_REPO,
|
180 |
local_dir=EVAL_REQUESTS_PATH_BACKEND)
|
181 |
|