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
7728b788
Unverified
Commit
7728b788
authored
Aug 09, 2024
by
Yunfei Chu
Committed by
GitHub
Aug 09, 2024
Browse files
Fix a bug in Qwen2Audio (#32552)
fix _update_model_kwargs_for_generation
parent
838d141f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
src/transformers/models/qwen2_audio/modeling_qwen2_audio.py
src/transformers/models/qwen2_audio/modeling_qwen2_audio.py
+1
-4
No files found.
src/transformers/models/qwen2_audio/modeling_qwen2_audio.py
View file @
7728b788
...
@@ -1328,13 +1328,10 @@ class Qwen2AudioForConditionalGeneration(Qwen2AudioPreTrainedModel):
...
@@ -1328,13 +1328,10 @@ class Qwen2AudioForConditionalGeneration(Qwen2AudioPreTrainedModel):
outputs
:
ModelOutput
,
outputs
:
ModelOutput
,
model_kwargs
:
Dict
[
str
,
Any
],
model_kwargs
:
Dict
[
str
,
Any
],
is_encoder_decoder
:
bool
=
False
,
is_encoder_decoder
:
bool
=
False
,
standardize_cache_format
:
bool
=
False
,
num_new_tokens
:
int
=
1
,
num_new_tokens
:
int
=
1
,
)
->
Dict
[
str
,
Any
]:
)
->
Dict
[
str
,
Any
]:
# update past_key_values keeping its naming used in model code
# update past_key_values keeping its naming used in model code
cache_name
,
cache
=
self
.
_extract_past_from_model_output
(
cache_name
,
cache
=
self
.
_extract_past_from_model_output
(
outputs
)
outputs
,
standardize_cache_format
=
standardize_cache_format
)
model_kwargs
[
cache_name
]
=
cache
model_kwargs
[
cache_name
]
=
cache
if
getattr
(
outputs
,
"state"
,
None
)
is
not
None
:
if
getattr
(
outputs
,
"state"
,
None
)
is
not
None
:
model_kwargs
[
"state"
]
=
outputs
.
state
model_kwargs
[
"state"
]
=
outputs
.
state
...
...
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