fix: tiny fix cli (#12744)

This commit is contained in:
Mick
2025-11-06 14:45:50 +08:00
committed by GitHub
parent 837b08eb2e
commit 73e9a2ef5c
8 changed files with 206 additions and 158 deletions

View File

@@ -1,6 +1,6 @@
import argparse
from sglang.cli.main import get_is_diffusion_model, get_model_path
from sglang.cli.utils import get_is_diffusion_model, get_model_path
from sglang.multimodal_gen.runtime.entrypoints.cli.generate import (
add_multimodal_gen_generate_args,
generate_cmd,
@@ -8,6 +8,13 @@ from sglang.multimodal_gen.runtime.entrypoints.cli.generate import (
def generate(args, extra_argv):
# If help is requested, show generate subcommand help without requiring --model-path
if any(h in extra_argv for h in ("-h", "--help")):
parser = argparse.ArgumentParser(description="SGLang Multimodal Generation")
add_multimodal_gen_generate_args(parser)
parser.parse_args(extra_argv)
return
model_path = get_model_path(extra_argv)
is_diffusion_model = get_is_diffusion_model(model_path)
if is_diffusion_model: