transformers
8924aef7 - Migrate granite_speech5 to the AudioProcessor architecture (issue 19)

Commit
73 days ago
Migrate granite_speech5 to the AudioProcessor architecture (issue 19) GraniteSpeech5AudioProcessor and its numpy sibling. The base pipeline turns out to be identical to granite_speech v4: the legacy extractor's logmel_floor_db=8.0 floor followed by /4 + 1 is exactly the clip_max_offset / post_log_shift / post_log_scale triple v4 already uses. What v5 adds is delta features, frame stacking and its own mask. torchaudio.functional.compute_deltas is reimplemented natively in both backends -- the backends deliberately do not depend on torchaudio. For a 2n+1 window the filter is sum(k * x[t+k]) / (n(n+1)(2n+1)/3) with the signal replicate-padded. One subtlety: the legacy extractor derives its frame count from the waveform as len // hop, one fewer than the centered STFT emits, then rounds up to a whole stacking group and trims. Recovering that from the emitted width is what makes the output bit-exact rather than one frame too long. Bit-exact against the legacy extractor on both output keys. The legacy FE becomes a make_legacy_audio_processor_alias shim, and the auto mapping's TODO(audio-processor) entries for granite_speech5_ctc and granite_speech5_encoder now point at the processor with a numpy sibling. No SequenceFeatureExtractor subclass remains for this model.
Author
Parents
Loading