Error with transformers >=4.50 and use_fast=True
#18
by
tfederico
- opened
This is how I load the processor and the model
model = CLIPModel.from_pretrained("openai/clip-vit-large-patch14-336").to(device)
processor = CLIPProcessor.from_pretrained("openai/clip-vit-large-patch14-336", use_fast=True)
However, if I set use_fast to True and try to use the processor, I get the following error:
File "/home/name/miniconda3/envs/test/lib/python3.10/site-packages/transformers/models/clip/processing_clip.py", line 97, in __call__
tokenizer_kwargs = {k: v for k, v in kwargs.items() if k not in self.image_processor._valid_processor_keys}
File "/home/name/miniconda3/envs/test/lib/python3.10/site-packages/transformers/models/clip/processing_clip.py", line 97, in <dictcomp>
tokenizer_kwargs = {k: v for k, v in kwargs.items() if k not in self.image_processor._valid_processor_keys}
AttributeError: 'CLIPImageProcessorFast' object has no attribute '_valid_processor_keys'
samsies!!