model: support DeepSeek-OCR-2 (#17897)
This commit is contained in:
@@ -12,6 +12,14 @@ class DeepseekOCRProcessor(BaseMultimodalProcessor):
|
||||
|
||||
def __init__(self, hf_config, server_args, _processor, *args, **kwargs):
|
||||
_processor.image_size = 640
|
||||
_processor.ocr2_mode = (
|
||||
str(
|
||||
getattr(getattr(hf_config, "vision_config", None), "model_name", "")
|
||||
).lower()
|
||||
== "deepencoderv2"
|
||||
or getattr(getattr(hf_config, "projector_config", None), "input_dim", None)
|
||||
== 896
|
||||
)
|
||||
super().__init__(hf_config, server_args, _processor, *args, **kwargs)
|
||||
self.mm_tokens = MultimodalSpecialTokens(
|
||||
image_token="<image>", image_token_id=self._processor.image_token_id
|
||||
|
||||
Reference in New Issue
Block a user