[https://nvbugs/5564465][fix] Overwrite only if default_max_tokens is legal (#8538)

Signed-off-by: Pengyun Lin <81065165+LinPoly@users.noreply.github.com>
This commit is contained in:
Pengyun Lin 2025-10-28 17:15:26 +08:00 committed by GitHub
parent db3c373d3a
commit b334102544
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -432,7 +432,7 @@ class BaseWorker(GenerationExecutor):
# default_max_tokens is the biggest available value
if max_tokens is None:
return default_max_tokens
elif max_tokens > default_max_tokens:
elif max_tokens > default_max_tokens and default_max_tokens > 0:
logger.warning(
f"User-specified `max_tokens` ({max_tokens}) is greater than deduced "
f"`default_max_tokens` ({default_max_tokens}), using default_max_tokens instead."