Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
from huggingface_hub import snapshot_download | |
from src.backend.manage_requests import set_eval_request | |
import time | |
def my_snapshot_download(repo_id, revision, local_dir, repo_type, max_workers): | |
for i in range(10): | |
try: | |
snapshot_download(repo_id=repo_id, revision=revision, local_dir=local_dir, repo_type=repo_type, max_workers=max_workers) | |
return | |
except Exception: | |
time.sleep(60) | |
return | |
def my_set_eval_request(api, eval_request, set_to_status, hf_repo, local_dir): | |
for i in range(10): | |
try: | |
set_eval_request(api=api, eval_request=eval_request, set_to_status=set_to_status, hf_repo=hf_repo, local_dir=local_dir) | |
return | |
except Exception: | |
time.sleep(60) | |
return | |