Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Add fixed sampling rate to feature extractor #49

Merged

Conversation

choiHkk
Copy link

@choiHkk choiHkk commented May 14, 2024

This PR addresses the warning message about the sampling rate discussed in #41 .
The code has been updated based on the latest commit, modifying only the parts where the sampling rate is declared and passed to the feature extractor.

before

        ...
        batch = self.feature_extractor(
            audios, return_tensors="pt", padding=self.padding, max_length=self.max_length
        )
        ...

after

        ...
        sampling_rate = self.feature_extractor.sampling_rate
        batch = self.feature_extractor(
            audios, sampling_rate=sampling_rate, return_tensors="pt", padding=self.padding, max_length=self.max_length
        )
        ...

Copy link
Collaborator

@sanchit-gandhi sanchit-gandhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks @choihk6610!

@sanchit-gandhi sanchit-gandhi merged commit c2b90bd into huggingface:main May 18, 2024
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.

None yet

3 participants