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
eec5841e
"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "c72e911f6ac0cfdc9281397be66fb3c08a2c2359"
Unverified
Commit
eec5841e
authored
Aug 15, 2023
by
Matt
Committed by
GitHub
Aug 15, 2023
Browse files
Use dynamic past key-values shape in TF-Whisper (#25523)
parent
ca514992
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/whisper/modeling_tf_whisper.py
src/transformers/models/whisper/modeling_tf_whisper.py
+1
-1
No files found.
src/transformers/models/whisper/modeling_tf_whisper.py
View file @
eec5841e
...
...
@@ -879,7 +879,7 @@ class TFWhisperDecoder(tf.keras.layers.Layer):
raise
ValueError
(
"You have to specify either decoder_input_ids or decoder_inputs_embeds"
)
# past_key_values_length
past_key_values_length
=
past_key_values
[
0
][
0
]
.
shape
[
2
]
if
past_key_values
is
not
None
else
0
past_key_values_length
=
tf
.
shape
(
past_key_values
[
0
][
0
]
)
[
2
]
if
past_key_values
is
not
None
else
0
if
inputs_embeds
is
None
:
check_embeddings_within_bounds
(
input_ids
,
self
.
embed_tokens
.
input_dim
)
...
...
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