Perform Batch Tokenization. (#5141)

This commit is contained in:
Sundara Raman Ramachandran
2025-04-20 18:10:37 -07:00
committed by GitHub
parent 2b3bdc938e
commit f08154193c
4 changed files with 434 additions and 30 deletions

View File

@@ -49,6 +49,7 @@ class ServerArgs:
tokenizer_path: Optional[str] = None
tokenizer_mode: str = "auto"
skip_tokenizer_init: bool = False
enable_tokenizer_batch_encode: bool = False
load_format: str = "auto"
trust_remote_code: bool = False
dtype: str = "auto"
@@ -432,6 +433,11 @@ class ServerArgs:
action="store_true",
help="If set, skip init tokenizer and pass input_ids in generate request",
)
parser.add_argument(
"--enable-tokenizer-batch-encode",
action="store_true",
help="Enable batch tokenization for improved performance when processing multiple text inputs. Do not use with image inputs, pre-tokenized input_ids, or input_embeds.",
)
parser.add_argument(
"--load-format",
type=str,