File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
vllm/model_executor/models Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -504,18 +504,12 @@ def dtype(self):
504504 return next (self .parameters ()).dtype
505505
506506 def _validate_pixel_values (self , data : torch .Tensor ) -> torch .Tensor :
507- h = w = self .config .vision_config .image_size
508- expected_dims = (3 , h , w )
509-
510- def _validate_shape (d : torch .Tensor ):
511- if d .shape != expected_dims :
512- raise ValueError (
513- "The expected shape of pixel values per image per batch "
514- f"is { expected_dims } . You supplied { tuple (d .shape )} ." )
515-
516- for d in data :
517- _validate_shape (d )
518-
507+ image_size = self .config .vision_config .image_size
508+ expected_dims = (3 , image_size , image_size )
509+ if data .shape [1 :] != expected_dims :
510+ raise ValueError (
511+ "The expected shape of pixel values per image per batch is "
512+ f"{ expected_dims } . You supplied { tuple (data .shape )} ." )
519513 return data
520514
521515 def _parse_and_validate_image_input (
You can’t perform that action at this time.
0 commit comments