[diffusion] fix: fix missing backend argument in pipelines_core initialization (#17343)

This commit is contained in:
Prozac614
2026-01-26 15:47:10 +08:00
committed by GitHub
parent d4adff31aa
commit 12f794e516
4 changed files with 10 additions and 7 deletions

View File

@@ -547,7 +547,7 @@ class PipelineConfig:
f"using {pipeline_config_cls.__name__} directly without model_index.json"
)
else:
model_info = get_model_info(model_path)
model_info = get_model_info(model_path, backend=kwargs.get("backend"))
if model_info is None:
from sglang.multimodal_gen.registry import (
_PIPELINE_CONFIG_REGISTRY,
@@ -563,7 +563,7 @@ class PipelineConfig:
)
pipeline_config_cls = model_info.pipeline_config_cls
else:
model_info = get_model_info(model_path)
model_info = get_model_info(model_path, backend=kwargs.get("backend"))
if model_info is None:
raise ValueError(
f"Could not get model info for '{model_path}'. "

View File

@@ -417,14 +417,17 @@ class SamplingParams:
def from_pretrained(cls, model_path: str, **kwargs) -> "SamplingParams":
from sglang.multimodal_gen.registry import get_model_info
model_info = get_model_info(model_path)
backend = kwargs.pop("backend", None)
model_info = get_model_info(model_path, backend=backend)
sampling_params: SamplingParams = model_info.sampling_param_cls(**kwargs)
return sampling_params
@staticmethod
def from_user_sampling_params_args(model_path: str, server_args, *args, **kwargs):
try:
sampling_params = SamplingParams.from_pretrained(model_path)
sampling_params = SamplingParams.from_pretrained(
model_path, backend=server_args.backend
)
except (AttributeError, ValueError) as e:
# Handle safetensors files or other cases where model_index.json is not available
# Use appropriate SamplingParams based on pipeline_class_name from registry

View File

@@ -180,7 +180,7 @@ async def available_models():
if not server_args:
raise HTTPException(status_code=500, detail="Server args not initialized")
model_info = get_model_info(server_args.model_path)
model_info = get_model_info(server_args.model_path, backend=server_args.backend)
card_kwargs = {
"id": server_args.model_path,
@@ -222,7 +222,7 @@ async def retrieve_model(model: str):
},
)
model_info = get_model_info(server_args.model_path)
model_info = get_model_info(server_args.model_path, backend=server_args.backend)
card_kwargs = {
"id": model,

View File

@@ -66,7 +66,7 @@ def build_pipeline(
)
else:
logger.info("No pipeline_class_name specified, using model_index.json")
model_info = get_model_info(model_path)
model_info = get_model_info(model_path, backend=server_args.backend)
pipeline_cls = model_info.pipeline_cls
logger.info(f"Using pipeline from model_index.json: {pipeline_cls.__name__}")