CLIPVisionModel ViT g-14 has no config.json

I was trying to load the vision model using


but when I do this locally on a linux machine I get the following error:

Traceback (most recent call last):
  File "/home/vedaant/", line 157, in <module>
    model = CLIPForImageClassification().cuda()
  File "/home/vedaant/", line 41, in __init__
    self.vision_model = CLIPVisionModel.from_pretrained('laion/CLIP-ViT-g-14-laion2B-s12B-b42K')
  File "/home/vedaant/miniconda3/envs/funnydataset/lib/python3.10/site-packages/transformers/", line 2305, in from_pretrained
    config, model_kwargs = cls.config_class.from_pretrained(
  File "/home/vedaant/miniconda3/envs/funnydataset/lib/python3.10/site-packages/transformers/models/clip/", line 233, in from_pretrained
    config_dict, kwargs = cls.get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/vedaant/miniconda3/envs/funnydataset/lib/python3.10/site-packages/transformers/", line 574, in get_config_dict
    config_dict, kwargs = cls._get_config_dict(pretrained_model_name_or_path, **kwargs)
  File "/home/vedaant/miniconda3/envs/funnydataset/lib/python3.10/site-packages/transformers/", line 629, in _get_config_dict
    resolved_config_file = cached_file(
  File "/home/vedaant/miniconda3/envs/funnydataset/lib/python3.10/site-packages/transformers/utils/", line 388, in cached_file
    raise EnvironmentError(
OSError: laion/CLIP-ViT-g-14-laion2B-s12B-b42K does not appear to have a file named config.json. Checkout '' for available files.

However, with the same code and the same version of transformers(4.30.2) on a kaggle notebook, I am able to load the CLIPVision Model using the same code as above on kaggle. Both the environments are using python 3.10. Also, the model card(laion/CLIP-ViT-g-14-laion2B-s12B-b42K · Hugging Face) does have all the necessary files, so I am not sure what is going wrong. Any help would be appreciated.

Thank you

Thank you for sharing.