[Bugfix][Model] Fix DeepSeek-OCR TensorSchema crash on empty images_crop (#36670)
Signed-off-by: István Ketykó <istvan.ketyko@gmail.com>
This commit is contained in:
@@ -452,10 +452,7 @@ class DeepseekOCRForCausalLM(nn.Module, SupportsMultiModal, SupportsPP, Supports
|
||||
# support arbitrary resolutions via pos-encoding interpolation,
|
||||
# so Tiny/Small/Base/Large variants all work with the same weights.
|
||||
base_size = pixel_values.shape[-1]
|
||||
if images_crop is not None and images_crop.numel() > 0:
|
||||
image_size = images_crop.shape[-1]
|
||||
else:
|
||||
image_size = base_size
|
||||
image_size = images_crop.shape[-1] if images_crop is not None else base_size
|
||||
|
||||
return DeepseekOCRImagePixelInputs(
|
||||
type="pixel_values",
|
||||
|
||||
Reference in New Issue
Block a user