Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
788730c6
Unverified
Commit
788730c6
authored
Dec 05, 2023
by
Vedat Baday
Committed by
GitHub
Dec 05, 2023
Browse files
fix(whisper): mutable generation config (#27833)
parent
ac975074
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/transformers/models/whisper/modeling_whisper.py
src/transformers/models/whisper/modeling_whisper.py
+2
-1
No files found.
src/transformers/models/whisper/modeling_whisper.py
View file @
788730c6
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
# limitations under the License.
# limitations under the License.
""" PyTorch Whisper model."""
""" PyTorch Whisper model."""
import
copy
import
math
import
math
import
warnings
import
warnings
from
typing
import
Optional
,
Tuple
,
Union
from
typing
import
Optional
,
Tuple
,
Union
...
@@ -1933,7 +1934,7 @@ class WhisperForConditionalGeneration(WhisperPreTrainedModel):
...
@@ -1933,7 +1934,7 @@ class WhisperForConditionalGeneration(WhisperPreTrainedModel):
)
)
if
generation_config
is
None
:
if
generation_config
is
None
:
generation_config
=
self
.
generation_config
generation_config
=
copy
.
deepcopy
(
self
.
generation_config
)
input_stride
=
self
.
model
.
encoder
.
conv1
.
stride
[
0
]
*
self
.
model
.
encoder
.
conv2
.
stride
[
0
]
input_stride
=
self
.
model
.
encoder
.
conv1
.
stride
[
0
]
*
self
.
model
.
encoder
.
conv2
.
stride
[
0
]
if
num_segment_frames
is
None
:
if
num_segment_frames
is
None
:
...
...
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