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

Failed to Download GPT2-large Model from Hub #30715

Open
4 tasks
daskol opened this issue May 8, 2024 · 3 comments
Open
4 tasks

Failed to Download GPT2-large Model from Hub #30715

daskol opened this issue May 8, 2024 · 3 comments

Comments

@daskol
Copy link

daskol commented May 8, 2024

System Info

py312, transformers 4.40.2, huggingface-hub 0.23.0.

Who can help?

@ArthurZucker and @younesbelkada

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

>>> from transformers import AutoModelForCausalLM
>>> model = AutoModelForCausalLM.from_pretrained('gpt2-large')
...
OSError: gpt2-large does not appear to have a file named config.json. Checkout 'https://huggingface.co/gpt2-large/tree/None' for available files.

It seems that tranformers failed to resolve branch and tried to find config.json in non-existing branch None.

Expected behavior

The script above has to download and load model.

@younesbelkada
Copy link
Contributor

Hi @daskol
Thanks for the issue ! Can you try with openai-community/gpt2-large instead ? We recently migrated the canonical models into dedicated organisations. It is surprising as automatic redirection should work, I just ran your snippet in my local env and it worked fine

@daskol
Copy link
Author

daskol commented May 18, 2024

Yes, openai-community/gpt2-large works for me as well. I have noticed that gpt2* repos were moved and populate them manually from openai-community/gpt2*. I think the issue exists in case if there is nothing cached.

@younesbelkada
Copy link
Contributor

Thanks @daskol !
Hmmm, that's strange, I tried

>>> from transformers import AutoModelForCausalLM
>>> model = AutoModelForCausalLM.from_pretrained("gpt2-large", force_download=True)

It seems the model is being downloaded correctly, force_download=True makes sure it re-downloads the model even if it is present in the cache

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

No branches or pull requests

2 participants