Skip to content

Does not work for newer versions of the transformers #26

Description

@Howuhh

Hi! Seems like the processor is broken for newer versions of the transformers library, it works for 4.44, but not for >=4.52:

inputs = self.processor(
            ^^^^^^^^^^^^^^^
 File "/home/user/conda/lib/python3.11/site-packages/transformers/models/llava_next/processing_llava_next.py", line 167, in __call__
   num_image_tokens = self._get_number_of_features(orig_height, orig_width, height, width)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/user/conda/lib/python3.11/site-packages/transformers/models/llava_next/processing_llava_next.py", line 188, in _get_number_of_features
   patches_height = height // self.patch_size
                    ~~~~~~~^^~~~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for //: 'int' and 'NoneType'

Difference between versions:
working: https://github.com/huggingface/transformers/blob/984bc11b0882ff1e5b34ba717ea357e069ceced9/src/transformers/models/llava_next/processing_llava_next.py

not working: https://github.com/huggingface/transformers/blob/51f94ea06d19a6308c61bbb4dc97c40aabd12bad/src/transformers/models/llava_next/processing_llava_next.py

Is there any quick fix? Maybe via specifying revision for the processor? Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions