-
Notifications
You must be signed in to change notification settings - Fork 31.2k
Open
Labels
Description
System Info
transformers>=4.55.0
Who can help?
No response
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
Hi, the code below did not check if the self.num_query_tokens is None, but in the __init__ method, the default value for this variable is None, which might cause error like:
TypeError: unsupported operand type(s) for -: 'int' and 'NoneType'
transformers/src/transformers/models/blip_2/processing_blip_2.py
Lines 109 to 110 in 6f6095e
| if max_length is not None: | |
| output_kwargs["text_kwargs"]["max_length"] = max_length - self.num_query_tokens |
I tried kpyu/video-blip-opt-2.7b-ego4d in transformers>=4.55.0 and it failed.
Expected behavior
The model can be successfully used.