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
7b175cfa
Unverified
Commit
7b175cfa
authored
Nov 08, 2023
by
Sanchit Gandhi
Committed by
GitHub
Nov 08, 2023
Browse files
[Flax Whisper] large-v3 compatibility (#27360)
parent
845aa832
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/transformers/models/whisper/modeling_flax_whisper.py
src/transformers/models/whisper/modeling_flax_whisper.py
+3
-1
No files found.
src/transformers/models/whisper/modeling_flax_whisper.py
View file @
7b175cfa
...
@@ -867,7 +867,7 @@ class FlaxWhisperPreTrainedModel(FlaxPreTrainedModel):
...
@@ -867,7 +867,7 @@ class FlaxWhisperPreTrainedModel(FlaxPreTrainedModel):
def
__init__
(
def
__init__
(
self
,
self
,
config
:
WhisperConfig
,
config
:
WhisperConfig
,
input_shape
:
Tuple
[
int
]
=
(
1
,
80
,
3000
)
,
input_shape
:
Tuple
[
int
]
=
None
,
seed
:
int
=
0
,
seed
:
int
=
0
,
dtype
:
jnp
.
dtype
=
jnp
.
float32
,
dtype
:
jnp
.
dtype
=
jnp
.
float32
,
_do_init
:
bool
=
True
,
_do_init
:
bool
=
True
,
...
@@ -875,6 +875,8 @@ class FlaxWhisperPreTrainedModel(FlaxPreTrainedModel):
...
@@ -875,6 +875,8 @@ class FlaxWhisperPreTrainedModel(FlaxPreTrainedModel):
**
kwargs
,
**
kwargs
,
):
):
module
=
self
.
module_class
(
config
=
config
,
dtype
=
dtype
,
gradient_checkpointing
=
gradient_checkpointing
,
**
kwargs
)
module
=
self
.
module_class
(
config
=
config
,
dtype
=
dtype
,
gradient_checkpointing
=
gradient_checkpointing
,
**
kwargs
)
if
input_shape
is
None
:
input_shape
=
(
1
,
config
.
num_mel_bins
,
2
*
config
.
max_source_positions
)
super
().
__init__
(
config
,
module
,
input_shape
=
input_shape
,
seed
=
seed
,
dtype
=
dtype
,
_do_init
=
_do_init
)
super
().
__init__
(
config
,
module
,
input_shape
=
input_shape
,
seed
=
seed
,
dtype
=
dtype
,
_do_init
=
_do_init
)
def
enable_gradient_checkpointing
(
self
):
def
enable_gradient_checkpointing
(
self
):
...
...
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