Skip to content

Commit

Permalink
Merge pull request exo-explore#698 from exo-explore/alwayslogdownload…
Browse files Browse the repository at this point in the history
…error

always log download errors. some people e.g cant access huggingface
  • Loading branch information
AlexCheema authored Feb 13, 2025
2 parents de99da7 + b4e6f8a commit be3b9ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exo/download/new_shard_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ async def download_file_with_retry(repo_id: str, revision: str, path: str, targe
try: return await _download_file(repo_id, revision, path, target_dir, on_progress)
except Exception as e:
if isinstance(e, FileNotFoundError) or attempt == n_attempts - 1: raise e
print(f"Download error on attempt {attempt}/{n_attempts} for {repo_id=} {revision=} {path=} {target_dir=}")
traceback.print_exc()
await asyncio.sleep(min(8, 0.1 * (2 ** attempt)))

async def _download_file(repo_id: str, revision: str, path: str, target_dir: Path, on_progress: Callable[[int, int], None] = lambda _, __: None) -> Path:
Expand Down

0 comments on commit be3b9ee

Please sign in to comment.