Skip to content

Commit 6c5872e

Browse files
authored
[Bugfix] Unset HF's default max_new_tokens for DiffusionGemma (#45417)
Signed-off-by: Martin Kukla <martin.kukla@cantab.net>
1 parent 1d88c4d commit 6c5872e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

vllm/model_executor/models/config.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,20 @@ def verify_and_update_config(cls, vllm_config: "VllmConfig") -> None:
158158
if sc is not None and sc.max_num_seqs >= SchedulerConfig.DEFAULT_MAX_NUM_SEQS:
159159
sc.max_num_seqs = 8
160160

161+
# Remove the model's generation_config.json cap on max_new_tokens
162+
# (256) so DiffusionGemma behaves like every other model: no
163+
# server-wide limit, each request controls its own output length
164+
# via max_tokens. Setting to None causes get_diff_sampling_param
165+
# to skip this key entirely.
166+
model_config = vllm_config.model_config
167+
if "max_new_tokens" not in model_config.override_generation_config:
168+
model_config.override_generation_config["max_new_tokens"] = None
169+
logger.info(
170+
"DiffusionGemma: removing server-wide max_new_tokens cap "
171+
"from generation_config.json (use "
172+
"--override-generation-config to set a custom limit).",
173+
)
174+
161175

162176
class DeepseekV4ForCausalLMConfig(VerifyAndUpdateConfig):
163177
@staticmethod

0 commit comments

Comments
 (0)