Skip to content

Commit 0ce16df

Browse files
AlexCheemaofauchon
authored andcommitted
handle -gzip suffix in etag for integrity check fixes exo-explore#633
1 parent 30c3f58 commit 0ce16df

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

exo/download/new_shard_download.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ async def download_file_with_retry(repo_id: str, revision: str, path: str, targe
141141
async def _download_file(repo_id: str, revision: str, path: str, target_dir: Path, on_progress: Callable[[int, int], None] = lambda _, __: None) -> Path:
142142
if await aios.path.exists(target_dir/path): return target_dir/path
143143
await aios.makedirs((target_dir/path).parent, exist_ok=True)
144-
length, remote_hash = await file_meta(repo_id, revision, path)
144+
length, etag = await file_meta(repo_id, revision, path)
145+
remote_hash = etag[:-5] if etag.endswith("-gzip") else etag
145146
partial_path = target_dir/f"{path}.partial"
146147
resume_byte_pos = (await aios.stat(partial_path)).st_size if (await aios.path.exists(partial_path)) else None
147148
if resume_byte_pos != length:

0 commit comments

Comments
 (0)