fix: pass hub token when embedding external files during push_to_hub#8285
Open
itxsamad1 wants to merge 1 commit into
Open
fix: pass hub token when embedding external files during push_to_hub#8285itxsamad1 wants to merge 1 commit into
itxsamad1 wants to merge 1 commit into
Conversation
Map-style Dataset.push_to_hub was calling embed_table_storage without token_per_repo_id, so embedding hf:// image/audio paths from gated source repos failed. Build a repo_id-to-token map from shard paths and pass it through, matching IterableDataset.push_to_hub. Fixes huggingface#6348
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dataset.push_to_hub(..., embed_external_files=True)embedshf://image/audio paths into Parquet shards._push_parquet_shards_to_hub_singlenow builds atoken_per_repo_idmap from shard paths (and destination repo metadata) and passes it toembed_table_storage, matching the existingIterableDataset.push_to_hubbehavior.Root cause
IterableDataset.push_to_hubalready usedpartial(embed_table_storage, token_per_repo_id=...), but the map-styleDatasetpush path calledembed_table_storagebare, so downloads from gated source repos failed during parquet conversion.Test plan
test_get_token_per_repo_id_for_embedunit testhf://image paths from a gated repo usingtoken=...Fixes #6348