mtmd: correcting duplicate empty audio chunks for short inputs - #26536
Conversation
| if [[ "$hf" == "ggml-org/Voxtral-Mini-3B-2507-GGUF:Q4_K_M" ]] \ | ||
| && ! grep -Fq "encoding mtmd batch, n_chunks = 1 (done = 1, total = 3)" <<< "$output"; then | ||
| result="$prefix \033[31mFAIL\033[0m: $hf (expected one audio chunk)" |
There was a problem hiding this comment.
this is too hacky, please revert
|
/bot review |
Automated code reviewI reviewed the diff and traced the full audio path ( ScopeTwo files changed: CorrectnessThe fix is sound. In if (n_samples < stage_2_pad + 1) { return false; }
std::reverse_copy(samples + 1, samples + 1 + stage_2_pad, samples_padded.begin());That reflection copy needs Will slow the review(point 1) The behavior change is broader than the PR description implies. (point 2) The new test assertion is brittle. It greps the exact literal Nits(point 3) The new comment This review was generated automatically by pi coding agent using |
please carefully test & validate all models using the same preprocessor class older whisper-based model always expect input to be padded |
|
Verified one representative GGUF for each affected model family.
All seven families passed both validation cases. All runs exited successfully without assertions or preprocessing errors. |
This comment was marked as outdated.
This comment was marked as outdated.
|
please ignore my last message, I misunderstood the intention of this fix IIRC the behavior was a bit buggy due to a security fix. I need to verify this one more time to make sure this fix is safe to merge |
…org#26536) * correcting duplicate empty audio chunks for short inputs * tests.sh code restored
…org#26536) * correcting duplicate empty audio chunks for short inputs * tests.sh code restored
…org#26536) * correcting duplicate empty audio chunks for short inputs * tests.sh code restored
Overview
Audio preprocessor padded all inputs under 31 sec up to the full 31 sec. This when combined with the spectrogram's 30 sec trailing padding, caused the short audio file to produce about 61 sec of frames, which resulted in an unnecessary extra padding only chunk sent to the encoder.
My fix changes the minimum input length to 201 samples (exact minimum for FFT reflection padding), which ensures short audio generates only necessary chunks and saves computation.
Requirements