Skip to content

Commit 56e5c65

Browse files
authored
fix
1 parent 7aecee4 commit 56e5c65

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lightllm/models/tarsier2/tarsier2_visual.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,8 @@ def encode(self, images: List[ImageItem]):
254254
image_data = read_shm(get_shm_name_data(img.uuid))
255255
image_data = Image.open(BytesIO(image_data))
256256
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"]
257+
pixel_values, image_grid_thw = self.processor.preprocess(image=image_data)
258+
pixel_values = pixel_values.to(dtype=torch.bfloat16)
260259
img_tensors.append(pixel_values)
261260
img_grids.append(image_grid_thw)
262261
else:

0 commit comments

Comments
 (0)