UKPLab / sentence-transformers

State-of-the-Art Text Embeddings
https://www.sbert.net
Apache License 2.0
14.99k stars 2.45k forks source link

OSError: Can't load config for 'cross-encoder/ms-marco-TinyBERT-L-6' #810

Closed chenzhutian closed 3 years ago

chenzhutian commented 3 years ago

python 3.6 pytorch 1.7.1 Is the model name changed? Thanks!

Traceback (most recent call last):
  File "/home/zhutian/.conda/envs/infospace/lib/python3.6/site-packages/transformers/configuration_utils.py", line 353, in get_config_dict
    raise EnvironmentError
OSError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "cross-wiki.py", line 18, in <module>
    cross_encoder = CrossEncoder('cross-encoder/ms-marco-TinyBERT-L-6')
  File "/home/zhutian/.conda/envs/infospace/lib/python3.6/site-packages/sentence_transformers/cross_encoder/CrossEncoder.py", line 36, in __init__
    self.config = AutoConfig.from_pretrained(model_name)
  File "/home/zhutian/.conda/envs/infospace/lib/python3.6/site-packages/transformers/configuration_auto.py", line 272, in from_pretrained
    config_dict, _ = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/zhutian/.conda/envs/infospace/lib/python3.6/site-packages/transformers/configuration_utils.py", line 362, in get_config_dict
    raise EnvironmentError(msg)
OSError: Can't load config for 'cross-encoder/ms-marco-TinyBERT-L-6'. Make sure that:

- 'cross-encoder/ms-marco-TinyBERT-L-6' is a correct model identifier listed on 'https://huggingface.co/models'

- or 'cross-encoder/ms-marco-TinyBERT-L-6' is the correct path to a directory containing a config.json file
nreimers commented 3 years ago

The name is correct: https://huggingface.co/cross-encoder/ms-marco-TinyBERT-L-6

Appears to be some issue with your environment

chenzhutian commented 3 years ago

any hints? Thanks!

nreimers commented 3 years ago

From that truncated error message sadly not

chenzhutian commented 3 years ago

I try to use "nboost/pt-bert-large-msmarco" and it works. super wried.

chenzhutian commented 3 years ago

image I git clone the model and load it in the local machine, and it shows me this

chenzhutian commented 3 years ago

upgrade transformer from 3.1.0 to 4.3.3 fix this issue