mgrankin / ru_transformers

Apache License 2.0
776 stars 108 forks source link

'GPT2Config' has no attribute 'pretrained_config_archive_map' #30

Closed olegchomp closed 3 years ago

olegchomp commented 4 years ago

Hi! Thank your for sharing your work! After installation i try to run rest.py and get this error:

ALL_MODELS = sum((tuple(conf.pretrained_config_archive_map.keys()) for conf in (GPT2Config, OpenAIGPTConfig, XLNetConfig, TransfoXLConfig)), ())
AttributeError: type object 'GPT2Config' has no attribute 'pretrained_config_archive_map'
mgrankin commented 4 years ago

Hi! This is probably due to the changes in huggingface/transformers. I'll look into possibility of making my repo up to date.

iSevenDays commented 4 years ago

I have the same issue, I saw there is a suggestion to use ALL_MODELS = sum((conf for conf in (GPT2Config.get_config_dict("gpt2"), OpenAIGPTConfig.get_config_dict("openai-gpt"))), ()) But it fails with error

    ALL_MODELS = sum((conf for conf in (GPT2Config.get_config_dict("gpt2"), OpenAIGPTConfig.get_config_dict("openai-gpt"))), ())
  File "/Users/seven/opt/miniconda3/envs/gpt/lib/python3.7/site-packages/transformers/configuration_utils.py", line 252, in get_config_dict
    raise EnvironmentError(msg)
OSError: Can't load config for 'gpt2'. Make sure that:

- 'gpt2' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'gpt2' is the correct path to a directory containing a config.json file
Kepler-Br commented 4 years ago

Hello! Try this:

git clone https://github.com/huggingface/transformers
cd transformers
git checkout d6ef587a10e0d8836376a2314d8aeae36ad63263
pip install .

It will install 2.5.1 version which is compatible. You should install it from source or it will Exception UnknownDevice

But I was unable to run training on colab TPU anyway because it shuts down for unknown reason. Will be happy if you'll help me with it or share a notebook

iSevenDays commented 4 years ago

Hello,

I used this fork https://github.com/Kepler-Br/ru_gpt2 <https://github.com/Kepler-Br/ru_gpt2 for CPU support on macOS.

I don't have CUDA.

I was able to get it working by using the following environment yml

name: gpt channels:

Thanks!

Kepler-Br commented 4 years ago

Welp, you'll need google colab pro if you want to train on TPU, because there is not enough RAM

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.