model: support DeepSeek-OCR-2 (#17897)

This commit is contained in:
baonudesifeizhai
2026-01-29 20:49:51 -05:00
committed by GitHub
parent 2cd2c3118d
commit 84ab611af8
9 changed files with 620 additions and 142 deletions

View File

@@ -59,14 +59,18 @@ def resolve_transformers_arch(model_config: ModelConfig, architectures: list[str
)
model_module = auto_modules["AutoModel"]
if model_config.model_impl == ModelImpl.TRANSFORMERS:
if not model_module.is_backend_compatible():
if hasattr(model_module, "is_backend_compatible") and (
not model_module.is_backend_compatible()
):
raise ValueError(
f"The Transformers implementation of {arch} is not "
"compatible with SGLang."
)
architectures[i] = "TransformersForCausalLM"
if model_config.model_impl == ModelImpl.AUTO:
if not model_module.is_backend_compatible():
if hasattr(model_module, "is_backend_compatible") and (
not model_module.is_backend_compatible()
):
raise ValueError(
f"{arch} has no SGlang implementation and the Transformers "
"implementation is not compatible with SGLang."