Add constrained_json_whitespace_pattern to ServerArgs (#1438)

This commit is contained in:
zifeitong
2024-09-16 13:29:18 -07:00
committed by GitHub
parent 2abe4f1cb6
commit 93dffd699b
3 changed files with 17 additions and 7 deletions

View File

@@ -70,6 +70,7 @@ class ServerArgs:
tp_size: int = 1
stream_interval: int = 1
random_seed: Optional[int] = None
constrained_json_whitespace_pattern: Optional[str] = None
# Logging
log_level: str = "info"
@@ -370,6 +371,12 @@ class ServerArgs:
default=ServerArgs.random_seed,
help="The random seed.",
)
parser.add_argument(
"--constrained-json-whitespace-pattern",
type=str,
default=ServerArgs.constrained_json_whitespace_pattern,
help=r"Regex pattern for syntactic whitespaces allowed in JSON constrained output. For example, to allow the model generate consecutive whitespaces, set the pattern to [\n\t ]*",
)
parser.add_argument(
"--log-level",
type=str,