huggingface / parler-tts

Inference and training library for high-quality TTS models.
Apache License 2.0
2.7k stars 276 forks source link

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

Closed choiHkk closed 2 weeks ago

choiHkk commented 2 weeks ago

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