Skip to content

Conversation

McVyp
Copy link

@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.

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