@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 78b8015a4d
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[Bugfix] Relax tokenizer regex for mixtral to include 'tokenizer.model' (#25964)

Signed-off-by: Bowen Bao <bowenbao@amd.com>

Bowen Bao committed Oct 3, 2025 at 15:31 UTC 78b8015a4d0f07be1836d78dfe9bfa70ebbfd431
1 file changed +11 -5
vllm/transformers_utils/tokenizers/mistral.py
+11 -5
@@ -122,15 +122,21 @@ def list_local_repo_files(repo_id: str, revision: Optional[str]) -> list[str]:
122
123
124 def find_tokenizer_file(files: list[str]):
125 + # Accept both versioned (tokenizer.model.v3) and unversioned
126 + # (tokenizer.model) forms, plus tekken.json and tokenizer.mm.model
127 + # variants. Previous pattern only matched the versioned variants.
128 file_pattern = re.compile(
126 - r"^tokenizer\.model\.v.*$|^tekken\.json$|^tokenizer\.mm\.model\.v.*$")
129 + r"^tokenizer\.model(\.v.*)?|tekken\.json|tokenizer\.mm\.model(\.v.*)?$"
130 + )
131
132 matched_files = [file for file in files if file_pattern.match(file)]
133 if len(matched_files) > 1:
130 - raise OSError(
131 - f"Found {len(matched_files)} files matching the "
132 - f"pattern: `{file_pattern.pattern}`. Make sure only one Mistral "
133 - f"tokenizer is present in {files}.")
134 + logger.warning(
135 + "Multiple files matched pattern `%s`: %s. Using %s.",
136 + file_pattern.pattern,
137 + matched_files,
138 + matched_files[0],
139 + )
140 elif len(matched_files) == 0:
141 raise OSError(
142 f"Found {len(matched_files)} files matching the "