Move stop words to args in send one (#20193)

This commit is contained in:
Ke Bao
2026-03-09 23:05:32 +08:00
committed by GitHub
parent eb4ba1bde2
commit 2e444bdced

View File

@@ -5,6 +5,7 @@ Usage:
python3 -m sglang.test.send_one
python3 -m sglang.test.send_one --profile --profile-steps 5
python3 -m sglang.test.send_one --profile --profile-by-stage
python3 -m sglang.test.send_one --stop "<|separator|>" "<|eos|>" --max-new-tokens 2048
"""
import argparse
@@ -36,6 +37,7 @@ class BenchArgs:
)
image: bool = False
many_images: bool = False
stop: Optional[list] = None
stream: bool = False
profile: bool = False
profile_steps: int = 3
@@ -66,6 +68,7 @@ class BenchArgs:
parser.add_argument("--json", action="store_true")
parser.add_argument("--return-logprob", action="store_true")
parser.add_argument("--prompt", type=str, default=BenchArgs.prompt)
parser.add_argument("--stop", type=str, nargs="*", default=None)
parser.add_argument("--image", action="store_true")
parser.add_argument("--many-images", action="store_true")
parser.add_argument("--stream", action="store_true")
@@ -135,7 +138,7 @@ def send_one_prompt(args: BenchArgs):
"frequency_penalty": args.frequency_penalty,
"presence_penalty": args.presence_penalty,
"json_schema": json_schema,
"stop": ["Question", "Assistant:", "<|separator|>", "<|eos|>"],
"stop": args.stop,
},
"return_logprob": args.return_logprob,
"stream": args.stream,