@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 7cdf7e2fe0
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 10, 10:15 UTC

[Model] Remove redundant None check in DeepSeekOCR image input processing (#32016)

Signed-off-by: maang <maang_h@163.com>

maang committed Jan 9, 2026 at 22:12 UTC 7cdf7e2fe0d406724659d84e0a17fde97f855a89
1 file changed +10 -13
vllm/model_executor/models/deepseek_ocr.py
+10 -13
@@ -438,19 +438,16 @@ class DeepseekOCRForCausalLM(nn.Module, SupportsMultiModal, SupportsPP, Supports
438 if pixel_values is None or torch.sum(pixel_values).item() == 0:
439 return None
440
441 - if pixel_values is not None:
442 - base_size = self.vision_config.image_size
443 - return DeepseekOCRImagePixelInputs(
444 - type="pixel_values",
445 - data=pixel_values,
446 - images_crop=images_crop,
447 - images_spatial_crop=images_spatial_crop,
448 - resolve_bindings={
449 - "base_size": base_size,
450 - },
451 - )
452 -
453 - raise AssertionError("This line should be unreachable.")
441 + base_size = self.vision_config.image_size
442 + return DeepseekOCRImagePixelInputs(
443 + type="pixel_values",
444 + data=pixel_values,
445 + images_crop=images_crop,
446 + images_spatial_crop=images_spatial_crop,
447 + resolve_bindings={
448 + "base_size": base_size,
449 + },
450 + )
451
452 def _encode_global_features(self, image_tensor: torch.Tensor) -> torch.Tensor:
453 global_features_1 = self.sam_model(image_tensor)