Simplify server startup output (#20885)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
a02cff7f2b
commit
0949b138af
@@ -14,13 +14,11 @@ def main():
|
||||
|
||||
# complex sub commands
|
||||
subparsers = parser.add_subparsers(dest="subcommand", required=True)
|
||||
|
||||
subparsers.add_parser(
|
||||
"serve",
|
||||
help="Launch the SGLang server.",
|
||||
help="Launch an SGLang server.",
|
||||
add_help=False,
|
||||
)
|
||||
|
||||
subparsers.add_parser(
|
||||
"generate",
|
||||
help="Run inference on a multimodal model.",
|
||||
|
||||
+20
-15
@@ -52,17 +52,13 @@ def serve(args, extra_argv):
|
||||
# we can't show the exact help. Instead, we show a general help message and then
|
||||
# the help for both possible server types.
|
||||
print(
|
||||
"Usage: sglang serve --model-path <model-name-or-path> [additional-arguments]\n"
|
||||
)
|
||||
print(
|
||||
"This command can launch either a standard language model server or a diffusion model server."
|
||||
)
|
||||
print("The server type is determined by the model path.\n")
|
||||
print(
|
||||
"Usage: sglang serve --model-path <model-name-or-path> [additional-arguments]\n\n"
|
||||
"This command can launch either a standard language model server or a diffusion model server.\n"
|
||||
"The server type is determined by the --model-path.\n"
|
||||
"Optional override: --model-type {auto,llm,diffusion} "
|
||||
"(default: auto, fallback to LLM on detection failure).\n"
|
||||
"(default: auto, fallback to LLM on detection failure)."
|
||||
)
|
||||
print("For specific arguments, please provide a model_path.")
|
||||
|
||||
print("\n--- Help for Standard Language Model Server ---")
|
||||
from sglang.srt.server_args import prepare_server_args
|
||||
|
||||
@@ -72,13 +68,22 @@ def serve(args, extra_argv):
|
||||
pass # argparse --help calls sys.exit
|
||||
|
||||
print("\n--- Help for Diffusion Model Server ---")
|
||||
from sglang.multimodal_gen.runtime.entrypoints.cli.serve import (
|
||||
add_multimodal_gen_serve_args,
|
||||
)
|
||||
try:
|
||||
from sglang.multimodal_gen.runtime.entrypoints.cli.serve import (
|
||||
add_multimodal_gen_serve_args,
|
||||
)
|
||||
|
||||
parser = argparse.ArgumentParser(description="SGLang Diffusion Model Serving")
|
||||
add_multimodal_gen_serve_args(parser)
|
||||
parser.print_help()
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="sglang serve",
|
||||
description="SGLang Diffusion Model Serving",
|
||||
)
|
||||
add_multimodal_gen_serve_args(parser)
|
||||
parser.print_help()
|
||||
except ImportError:
|
||||
print(
|
||||
"Diffusion model support is not available. "
|
||||
'Install with: pip install "sglang[diffusion]"'
|
||||
)
|
||||
return
|
||||
|
||||
model_type, dispatch_argv = _extract_model_type_override(extra_argv)
|
||||
|
||||
@@ -80,8 +80,7 @@ def get_model_path(extra_argv):
|
||||
raise Exception(
|
||||
"Usage: sglang serve --model-path <model-name-or-path> [additional-arguments]\n\n"
|
||||
"This command can launch either a standard language model server or a diffusion model server.\n"
|
||||
"The server type is determined by the model path.\n"
|
||||
"For specific arguments, please provide a model_path."
|
||||
"The server type is determined by the --model-path.\n"
|
||||
)
|
||||
else:
|
||||
raise Exception(
|
||||
|
||||
Reference in New Issue
Block a user