Skip to content

Commit

Permalink
Make asset integrity check optional
Browse files Browse the repository at this point in the history
  • Loading branch information
PeanutButterRat committed Oct 23, 2024
1 parent 6794722 commit 4d0adf5
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 2 deletions.
Empty file modified ci/docker/build-manylinux-images.sh
100755 → 100644
Empty file.
Empty file modified ci/docker/manylinux_x86_64/build-scripts/install-cuda-11.6.sh
100755 → 100644
Empty file.
Empty file modified ci/docker/manylinux_x86_64/build-scripts/install-cuda-11.7.sh
100755 → 100644
Empty file.
Empty file modified ci/docker/manylinux_x86_64/build-scripts/install-cuda-11.8.sh
100755 → 100644
Empty file.
Empty file modified ci/docker/manylinux_x86_64/build-scripts/install-cuda-12.1.sh
100755 → 100644
Empty file.
Empty file modified ci/docker/manylinux_x86_64/build-scripts/install-llvm.sh
100755 → 100644
Empty file.
10 changes: 8 additions & 2 deletions src/fairseq2/assets/download_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,13 @@ def download_dataset(

return op.run()

def _validate_asset_integrity(self, path: Path, checksum: str) -> None:
def _validate_asset_integrity(self, path: Path, checksum: str | None) -> None:
if checksum is None:
log.warning(
f"Asset at {path} has no recorded checksum, skipping integrity check."
)
return

BYTES_PER_CHUNK = 65536
sha = sha1()

Expand All @@ -201,7 +207,7 @@ def _validate_asset_integrity(self, path: Path, checksum: str) -> None:

if sha.hexdigest() != checksum:
raise AssetDownloadError(
"Downloaded asset checksum does not match the expected checksum."
f"Checksum for {path} checksum does not match the expected checksum."
)


Expand Down
Empty file modified tools/run-shellcheck.sh
100755 → 100644
Empty file.
Empty file modified tools/set-project-version.sh
100755 → 100644
Empty file.

0 comments on commit 4d0adf5

Please sign in to comment.