Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support checksum in AssetDownloadManager #839

Open
cbalioglu opened this issue Oct 16, 2024 · 0 comments · May be fixed by #840
Open

Support checksum in AssetDownloadManager #839

cbalioglu opened this issue Oct 16, 2024 · 0 comments · May be fixed by #840
Labels
enhancement New feature or request

Comments

@cbalioglu
Copy link
Contributor

As of today, the InProcAssetDownloadManager does not have any checks to make sure that downloaded assets (e.g. model checkpoints, datasets, tokenizers) have not been tampered with. Ideally we would like to have an optional "checksum" field in asset cards that the download manager can use to verify the integrity of a downloaded file.

from fairseq2.assets import default_asset_store, InProcDownloadManager

card = default_asset_store.retrieve_card("mistral_7b")

checkpoint_uri = card.field("checkpoint").as_uri()

# We should check if the card has a checksum field; if not, `get_as_` returns None.
checksum = card.field("checksum").get_as_(str)

download_manager = InProcDownloadManager()

download_manager.download_checkpoint(checkpoint_uri, model_name="mistral")

# The API of the download manager should be extended with an additional "checksum" parameter.
# download_manager.download_checkpoint(checkpoint_uri, checksum, model_name="mistral")
@cbalioglu cbalioglu added the enhancement New feature or request label Oct 16, 2024
@PeanutButterRat PeanutButterRat linked a pull request Nov 11, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant