fix: reduce max_new_tokens default from 32768 to 4096#279
Open
Bortlesboat wants to merge 1 commit intomicrosoft:mainfrom
Open
fix: reduce max_new_tokens default from 32768 to 4096#279Bortlesboat wants to merge 1 commit intomicrosoft:mainfrom
Bortlesboat wants to merge 1 commit intomicrosoft:mainfrom
Conversation
The 32768 default forces PyTorch to pre-allocate KV-cache for 32K output tokens regardless of input length, causing OOM on consumer GPUs (24GB) even for short audio. 4096 tokens is sufficient for ~1 hour of ASR output and matches the default already used in the vLLM API client. Users processing very long audio can still pass --max_new_tokens=32768.
LONEWOLF3399
approved these changes
Mar 30, 2026
codeCraft-Ritik
left a comment
There was a problem hiding this comment.
Great fix! Reducing the default max_new_tokens significantly improves usability on limited GPU memory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default
max_new_tokens=32768in the ASR demo scripts forces PyTorch to pre-allocate KV-cache for 32K output tokens regardless of actual input length. This causes OOM on 24GB GPUs even for short audio clips (see #210).4096 tokens is sufficient for transcribing ~1 hour of speech and matches the default already used in
gradio_asr_demo_api_video.py(line 779). Users who need more can still pass--max_new_tokens=32768explicitly.Changed files:
demo/vibevoice_asr_inference_from_file.py— default 32768 → 4096demo/vibevoice_asr_gradio_demo.py— default 32768 → 4096