-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
transformers.pipeline does not load tokenizer passed as string for custom models #31669
Closed
3 of 4 tasks
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
System Info
transformers
version: 4.42.1Who can help?
@Narsil
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
These requirements means this happens for custom models only (not integrated into the library), AFAIK. Running those requires trust_remote_code=True, so it might be wise to create your own example meeting these requirements. I will be using "tcheda/mot_test".
The bug is probably at
transformers/src/transformers/pipelines/__init__.py
Line 907 in 1c68f2c
load_tokenizer = type(model_config) in TOKENIZER_MAPPING or model_config.tokenizer_class is not None
This isn't set when
tokenizer
is a string, so the tokenizer initialization block (which contains proper handling of the string case) attransformers/src/transformers/pipelines/__init__.py
Line 907 in 1c68f2c
Expected behavior
The pipeline should be created correctly, loading the tokenizer as if with AutoTokenizer.from_pretrained(tokenizer). This is the behaviour described in the docs.
The text was updated successfully, but these errors were encountered: