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

Fix from_pretrained kwargs forward #18387

Merged
merged 1 commit into from
Aug 1, 2022
Merged

Conversation

YouJiacheng
Copy link
Contributor

@YouJiacheng YouJiacheng commented Aug 1, 2022

I don't know whether use_auth_token, cache_dir and local_files_only should be passed to (cls.slow_tokenizer_class)._from_pretrained, but I guess it should.
Please correct me if anything is wrong.

What does this PR do?

Fixes #18385

@sgugger @LysandreJik

BTW, I find #13523 and #14508 addressing similar problems, which shows current implementation is vulnerable to this kind of problems, a refactor might be needed. A context manager might be suitable as a long-range dependency injector.

Fix huggingface#18385
I don't know whether `use_auth_token`, `cache_dir` and `local_files_only` should be passed to `(cls.slow_tokenizer_class)._from_pretrained`, but I guess it should.
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 1, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

@sgugger sgugger merged commit 1cd7c6f into huggingface:main Aug 1, 2022
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.

local_files_only is not passed to _from_pretrained in PreTrainedTokenizerBase.from_pretrained
3 participants