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

Add trust_remote_code argument to ReaderHfds #2326

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

grodino
Copy link
Contributor

@grodino grodino commented Nov 8, 2024

Hi !

Some datasets on huggingface require the execution of code downloaded from the hub.
Since a few months, this now requires to set the flag trust_remote_code=True in load_dataset().

This PR adds the trust_remote_code argument to ReaderHfds. This means that we can now do:

from timm.data import create_dataset

imagenet = create_dataset(
    "hfds/imagenet-1k",
    root="data/,
    download=True,
    split="train",
    trust_remote_code=True,
)

Best,
Augustin

@rwightman
Copy link
Collaborator

@grodino thanks, looks good... I'll merge this now, if you want to also add arg support in train.py and validation.py and ensure create_dataset is called with the flag from args .... something like --dataset-trust-remote-code (in case I add model remote code support eventually), that'd be a good follow on PR :)

@grodino
Copy link
Contributor Author

grodino commented Nov 8, 2024

Sure, done 👉 #2328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants