onnxruntime
86aae8c0 - Fix Whisper genai_config context_length using wrong config attribute (#28600)

Commit
44 days ago
Fix Whisper genai_config context_length using wrong config attribute (#28600) ## Description `WhisperConfig` does not have a `max_length` attribute. Accessing `config.max_length` falls back to the `PretrainedConfig` default (20) in some transformers versions, causing a runtime error: ``` RuntimeError: max_length (448) cannot be greater than model context_length (20) ``` ## Fix Use `config.max_target_positions` (always 448 for all Whisper variants) instead of `config.max_length` for both `context_length` and `search.max_length` in the generated `genai_config.json`. ## Testing Verified that `max_target_positions` is correctly set to 448 for whisper-tiny, whisper-medium, and whisper-large-v3-turbo. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
Parents
Loading