[feat]Ascend NPU Gemma-3-12b and Gemma-3-27b support (#8909)

This commit is contained in:
VDV1985
2025-08-31 10:25:07 +03:00
committed by GitHub
parent c112bcc461
commit ba861293cf
6 changed files with 136 additions and 30 deletions

View File

@@ -13,7 +13,9 @@ from PIL import Image
from transformers import BaseImageProcessorFast
from sglang.srt.managers.schedule_batch import Modality, MultimodalDataItem
from sglang.srt.utils import load_audio, load_image, load_video, logger
from sglang.srt.utils import is_npu, load_audio, load_image, load_video, logger
_is_npu = is_npu()
@dataclasses.dataclass
@@ -232,7 +234,7 @@ class BaseMultimodalProcessor(ABC):
and isinstance(processor.image_processor, BaseImageProcessorFast)
and not self.server_args.disable_fast_image_processor
):
kwargs["device"] = "cuda"
kwargs["device"] = "cuda" if not _is_npu else "npu"
result = processor.__call__(
text=[input_text],
padding=True,