Support Dots.ocr model (#11071)
This commit is contained in:
@@ -5,6 +5,7 @@ from typing import Dict, List, Union
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from sglang.srt.models.dots_ocr import DotsOCRForCausalLM
|
||||
from sglang.srt.models.dots_vlm import DotsVLMForCausalLM
|
||||
from sglang.srt.multimodal.processors.base_processor import (
|
||||
BaseMultimodalProcessor,
|
||||
@@ -14,7 +15,7 @@ from sglang.srt.multimodal.processors.qwen_vl import resize_image_async
|
||||
|
||||
|
||||
class DotsVLMImageProcessor(BaseMultimodalProcessor):
|
||||
models = [DotsVLMForCausalLM]
|
||||
models = [DotsVLMForCausalLM, DotsOCRForCausalLM]
|
||||
|
||||
def __init__(self, hf_config, server_args, _processor, *args, **kwargs):
|
||||
super().__init__(hf_config, server_args, _processor, *args, **kwargs)
|
||||
@@ -82,11 +83,9 @@ class DotsVLMImageProcessor(BaseMultimodalProcessor):
|
||||
for image in base_output.images
|
||||
]
|
||||
base_output.images = await asyncio.gather(*resize_tasks)
|
||||
|
||||
combined_mm_item, input_ids, _ = self.process_and_combine_mm_data(
|
||||
base_output, self.mm_tokens
|
||||
)
|
||||
|
||||
if combined_mm_item is None:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user