Transformers CLI tool: error: invalid choice: 'repo'

kouohhashi
Wed, 25 Nov 2020 07:33:51 +0000

I created a repo on the website and uploaded the model.
but it seems i can not load the model I just uploaded.

OSError                                   Traceback (most recent call last)
~/anaconda3/envs/fastaiv2/lib/python3.7/site-packages/transformers/configuration_utils.py in get_config_dict(cls, pretrained_model_name_or_path, **kwargs)
    355             if resolved_config_file is None:
--> 356                 raise EnvironmentError
    357             config_dict = cls._dict_from_json_file(resolved_config_file)

OSError:

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
<ipython-input-13-1f125ff93000> in <module>
      1 from transformers import AutoTokenizer, AutoModel
      2
----> 3 tokenizer = AutoTokenizer.from_pretrained("kouohhashi/roberta_ja")
      4
      5 model = AutoModel.from_pretrained("kouohhashi/roberta_ja")

~/anaconda3/envs/fastaiv2/lib/python3.7/site-packages/transformers/tokenization_auto.py in from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs)
    204         config = kwargs.pop("config", None)
    205         if not isinstance(config, PretrainedConfig):
--> 206             config = AutoConfig.from_pretrained(pretrained_model_name_or_path, **kwargs)
    207
    208         if "bert-base-japanese" in str(pretrained_model_name_or_path):

~/anaconda3/envs/fastaiv2/lib/python3.7/site-packages/transformers/configuration_auto.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
    297             {'foo': False}
    298         """
--> 299         config_dict, _ = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
    300
    301         if "model_type" in config_dict:

~/anaconda3/envs/fastaiv2/lib/python3.7/site-packages/transformers/configuration_utils.py in get_config_dict(cls, pretrained_model_name_or_path, **kwargs)
    363                 f"- or '{pretrained_model_name_or_path}' is the correct path to a directory containing a {CONFIG_NAME} file\n\n"
    364             )
--> 365             raise EnvironmentError(msg)
    366
    367         except json.JSONDecodeError:

OSError: Can't load config for 'kouohhashi/roberta_ja'. Make sure that:

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

- or 'kouohhashi/roberta_ja' is the correct path to a directory containing a config.json file

I can find my mode on https://huggingface.co/models

Thanks in advance.