We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7aecee4 commit 56e5c65Copy full SHA for 56e5c65
lightllm/models/tarsier2/tarsier2_visual.py
@@ -254,9 +254,8 @@ def encode(self, images: List[ImageItem]):
254
image_data = read_shm(get_shm_name_data(img.uuid))
255
image_data = Image.open(BytesIO(image_data))
256
image_data = resize_image(image_data)
257
- image_inputs = self.processor.preprocess(images=image_data, return_tensors="pt")
258
- pixel_values = image_inputs["pixel_values"].to(dtype=torch.bfloat16)
259
- image_grid_thw = image_inputs["image_grid_thw"]
+ pixel_values, image_grid_thw = self.processor.preprocess(image=image_data)
+ pixel_values = pixel_values.to(dtype=torch.bfloat16)
260
img_tensors.append(pixel_values)
261
img_grids.append(image_grid_thw)
262
else:
0 commit comments