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

couldn't load pretrained gpt2 #9

Closed
DeepInEvil opened this issue Jun 3, 2020 · 3 comments
Closed

couldn't load pretrained gpt2 #9

DeepInEvil opened this issue Jun 3, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@DeepInEvil
Copy link

It gives an error while loading gpt2
File "/home/debanjan/anaconda3/envs/py_3/lib/python3.7/site-packages/lm_scorer/models/gpt2.py", line 84, in _supported_model_names
return GPT2LMHeadModel.pretrained_model_archive_map.keys()
AttributeError: type object 'GPT2LMHeadModel' has no attribute 'pretrained_model_archive_map'

can you kindly check?

@simonepri simonepri added the bug Something isn't working label Jun 3, 2020
@simonepri
Copy link
Owner

Thanks for reporting, I'll have a look.

@DeepInEvil
Copy link
Author

I did a quick fix, just import GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP and return GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP.keys() instead of GPT2LMHeadModel.pretrained_model_archive_map.keys()

@simonepri
Copy link
Owner

simonepri commented Jun 4, 2020

Fixed in v0.4.2.

Apparently they removed the pretrained_model_archive_map in huggingface/transformers#4152.

Thanks for reporting!

@simonepri simonepri self-assigned this Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants