xlang-ai / instructor-embedding

[ACL 2023] One Embedder, Any Task: Instruction-Finetuned Text Embeddings
Apache License 2.0
1.88k stars 135 forks source link

Can't load config for 'sentence-transformers/gtr-t5-large' #16

Closed AbhinavGopal closed 1 year ago

AbhinavGopal commented 1 year ago

Running the following command: python train.py --model_name_or_path sentence-transformers/gtr-t5-large --output_dir . --cache_dir medi-data/medi-data.json --max_source_length 512 --num_train_epochs 10 --save_steps 500 --cl_temperature 0.01 --warmup_ratio 0.1 --learning_rate 2e-5 --overwrite_output_dir

and receiving the following error repeatedly:

  File "/home/engineering/instructor-embedding/train.py", line 570, in <module>
    main()
  File "/home/engineering/instructor-embedding/train.py", line 423, in main
    tokenizer = AutoTokenizer.from_pretrained(
  File "/home/engineering/miniconda3/lib/python3.10/site-packages/transformers/models/auto/tokenization_auto.py", line 535, in from_pretrained
    config = AutoConfig.from_pretrained(
  File "/home/engineering/miniconda3/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 705, in from_pretrained
    config_dict, _ = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/engineering/miniconda3/lib/python3.10/site-packages/transformers/configuration_utils.py", line 553, in get_config_dict
    config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/engineering/miniconda3/lib/python3.10/site-packages/transformers/configuration_utils.py", line 641, in _get_config_dict
    raise EnvironmentError(
OSError: Can't load config for 'sentence-transformers/gtr-t5-large'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'sentence-transformers/gtr-t5-large' is the correct path to a directory containing a config.json file```

I even tried copying the config.json (from https://huggingface.co/sentence-transformers/gtr-t5-large/blob/main/config.json) into a directory I created in sentence-transformers/gtr-t5-large, but I receive the same error.

Harry-hash commented 1 year ago

Hi, Thanks a lot for your interest in INSTRUCTOR!

You may try the following command:

python train.py --model_name_or_path sentence-transformers/gtr-t5-large --output_dir . --cache_dir medi-data --max_source_length 512 --num_train_epochs 10 --save_steps 500 --cl_temperature 0.01 --warmup_ratio 0.1 --learning_rate 2e-5 --overwrite_output_dir

Feel free to add any further comments or questions here!

AbhinavGopal commented 1 year ago

Gotcha, thanks! Got a bit confused by the path to cache_dir from the readme :)