Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
881fa716
Unverified
Commit
881fa716
authored
Dec 30, 2022
by
bofeng huang
Committed by
GitHub
Dec 30, 2022
Browse files
Fix error message in `WhisperFeatureExtractor` (#20936)
* Fix error message * Fix code quality
parent
491a33d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/transformers/models/whisper/feature_extraction_whisper.py
...transformers/models/whisper/feature_extraction_whisper.py
+3
-3
No files found.
src/transformers/models/whisper/feature_extraction_whisper.py
View file @
881fa716
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment