[Model] Remove redundant None check in DeepSeekOCR image input processing (#32016)
Signed-off-by: maang <maang_h@163.com>
This commit is contained in:
@@ -438,7 +438,6 @@ class DeepseekOCRForCausalLM(nn.Module, SupportsMultiModal, SupportsPP, Supports
|
||||
if pixel_values is None or torch.sum(pixel_values).item() == 0:
|
||||
return None
|
||||
|
||||
if pixel_values is not None:
|
||||
base_size = self.vision_config.image_size
|
||||
return DeepseekOCRImagePixelInputs(
|
||||
type="pixel_values",
|
||||
@@ -450,8 +449,6 @@ class DeepseekOCRForCausalLM(nn.Module, SupportsMultiModal, SupportsPP, Supports
|
||||
},
|
||||
)
|
||||
|
||||
raise AssertionError("This line should be unreachable.")
|
||||
|
||||
def _encode_global_features(self, image_tensor: torch.Tensor) -> torch.Tensor:
|
||||
global_features_1 = self.sam_model(image_tensor)
|
||||
global_features_2 = self.vision_model(image_tensor, global_features_1)
|
||||
|
||||
Reference in New Issue
Block a user