"docs/tools/git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "5a7c6eca7432d4d1a61829e34e399f230455f888"
Unverified Commit 881fa716 authored by bofeng huang's avatar bofeng huang Committed by GitHub
Browse files

Fix error message in `WhisperFeatureExtractor` (#20936)

* Fix error message

* Fix code quality
parent 491a33d1
...@@ -271,9 +271,9 @@ class WhisperFeatureExtractor(SequenceFeatureExtractor): ...@@ -271,9 +271,9 @@ class WhisperFeatureExtractor(SequenceFeatureExtractor):
if sampling_rate is not None: if sampling_rate is not None:
if sampling_rate != self.sampling_rate: if sampling_rate != self.sampling_rate:
raise ValueError( raise ValueError(
f"The model corresponding to this feature extractor: {self} was trained using a sampling rate of" f"The model corresponding to this feature extractor: {self.__class__.__name__} was trained using a"
f" {self.sampling_rate}. Please make sure that the provided `raw_speech` input was sampled with" f" sampling rate of {self.sampling_rate}. Please make sure that the provided `raw_speech` input"
f" {self.sampling_rate} and not {sampling_rate}." f" was sampled with {self.sampling_rate} and not {sampling_rate}."
) )
else: else:
logger.warning( logger.warning(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment