Skip to content

Commit

Permalink
🐛 fix(llava_onevision): use isinstance for type checking of visual input
Browse files Browse the repository at this point in the history
  • Loading branch information
pufanyi committed Dec 22, 2024
1 parent 7f9c482 commit 67b582e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lmms_eval/models/llava_onevision.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ def loglikelihood(self, requests: List[Instance]) -> List[Tuple[float, bool]]:

task_type = "video"

elif type(visual[0]) == PIL.Image.Image:
# elif type(visual[0]) == PIL.Image.Image:
elif isinstance(visual[0], PIL.Image.Image):
image_tensor = process_images(visual, self._image_processor, self._config)
if type(image_tensor) is list:
image_tensor = [_image.to(dtype=torch.float16, device=self.device) for _image in image_tensor]
Expand Down

0 comments on commit 67b582e

Please sign in to comment.