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

AutoConfig.from_pretrained("model", return_unused_kwargs=True) returns "_from_auto": True field against specification #17056

Closed
2 of 4 tasks
GabrielKP opened this issue May 3, 2022 · 1 comment · Fixed by #17063
Labels

Comments

@GabrielKP
Copy link

GabrielKP commented May 3, 2022

System Info

- `transformers` version: 4.17.0
- Platform: Linux-5.13.0-40-generic-x86_64-with-glibc2.34
- Python version: 3.9.7
- PyTorch version (GPU?): 1.11.0+cu102 (False)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed

Who can help?

@sgugger

Small bug in which for some cases {"_from_auto": True} is returned against specification.

Seems to originate here and/or here

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

Replicable with

>>> from transformers import AutoConfig
>>> config, kwargs = AutoConfig.from_pretrained("bert-base-uncased", return_unused_kwargs=True)
>>> kwargs
{'_from_auto': True}

Expected behavior

There should be no "_from_auto": True field in returned dict.

>>> from transformers import AutoConfig
>>> config, kwargs = AutoConfig.from_pretrained("bert-base-uncased", return_unused_kwargs=True)
>>> kwargs
{}
@GabrielKP GabrielKP added the bug label May 3, 2022
@sgugger
Copy link
Collaborator

sgugger commented May 3, 2022

I can reproduce, thanks for flagging and for taking the time to give us a clear example of code that fails!
I will try to dive into this and have a fix ready later today.

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

Successfully merging a pull request may close this issue.

2 participants