parsbert icon indicating copy to clipboard operation
parsbert copied to clipboard

cant download model "bert-fa-zwnj-base" from huggingface

Open lovecode2020 opened this issue 2 years ago • 0 comments

`

from transformers import AutoConfig, AutoTokenizer, AutoModel,

# v3.0
model_name_or_path = "HooshvareLab/bert-fa-zwnj-base"
config = AutoConfig.from_pretrained(model_name_or_path)
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)

` #--------------------------------------------------------------------------- #OSError Traceback (most recent call last) ~/Apps/anaconda3/envs/ml/lib/python3.9/site-packages/transformers/configuration_utils.py in get_config_dict(cls, pretrained_model_name_or_path, **kwargs) 358 if resolved_config_file is None: --> 359 raise EnvironmentError 360 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) /tmp/ipykernel_708815/1307679045.py in 3 # v3.0 4 model_name_or_path = "HooshvareLab/bert-fa-zwnj-base" ----> 5 config = AutoConfig.from_pretrained(model_name_or_path) 6 tokenizer = AutoTokenizer.from_pretrained(model_name_or_path)

~/Apps/anaconda3/envs/ml/lib/python3.9/site-packages/transformers/configuration_auto.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs) 308 {'foo': False} 309 """ --> 310 config_dict, _ = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs) 311 312 if "model_type" in config_dict:

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

OSError: Can't load config for 'HooshvareLab/bert-fa-zwnj-base'. Make sure that:

  • 'HooshvareLab/bert-fa-zwnj-base' is a correct model identifier listed on 'https://huggingface.co/models'

  • or 'HooshvareLab/bert-fa-zwnj-base' is the correct path to a directory containing a config.json file

lovecode2020 avatar Apr 11 '22 09:04 lovecode2020