Skip to content

Conversation

@McVyp
Copy link
Contributor

@McVyp McVyp commented Apr 23, 2025

This addresses an issue in the Whisper feature extraction example in Preprocessing Audio Data documentation where the example code doesn't handle sampling rate mismatches.

I encountered a ValueError when using the example code with the MINDS14 dataset (8 kHz) since Whisper requires 16 kHz audio. While the documentation mentions using cast_column for resampling in another section, this approach didn't resolve the error when used with the Whisper feature extractor.

Changes made:

  • Updated the prepare_dataset function to explicitly handle sampling rate mismatches
  • Added direct resampling with librosa which successfully resolves the error
  • Ensured the example works end-to-end with datasets that have different sampling rates

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Deep-unlearning Deep-unlearning self-requested a review October 13, 2025 08:30
@Deep-unlearning Deep-unlearning merged commit b5a2f28 into huggingface:main Oct 13, 2025
2 checks passed
@McVyp McVyp deleted the fix-whisper-sampling-rate-doc branch October 14, 2025 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants