File "/opt/anaconda/envs/transformers/lib/python3.11/site-packages/mistral_inference/transformer.py", line 162, in forward_partial
if self.vision_encoder is not None and images:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Boolean value of Tensor with more than one value is ambiguous
Python -VV
Pip Freeze
Reproduction Steps
Running forward_partial() with Pixtral led to the above mentioned issue. See the code below for my script
Expected Behavior
Expected model.forward_partial() to output the vector representations of the input tokens
Additional Context
No response
Suggested Solutions
Change line 162 in mistral-inference/blob/main/src/mistral_inference/transformer.py
current:
if self.vision_encoder is not None and images:
proposed solution:
if self.vision_encoder is not None and images is not None:
This led to the code to functioning properly