Unverified Commit 7728b788 authored by Yunfei Chu's avatar Yunfei Chu Committed by GitHub
Browse files

Fix a bug in Qwen2Audio (#32552)

fix _update_model_kwargs_for_generation
parent 838d141f
......@@ -1328,13 +1328,10 @@ class Qwen2AudioForConditionalGeneration(Qwen2AudioPreTrainedModel):
outputs: ModelOutput,
model_kwargs: Dict[str, Any],
is_encoder_decoder: bool = False,
standardize_cache_format: bool = False,
num_new_tokens: int = 1,
) -> Dict[str, Any]:
# update past_key_values keeping its naming used in model code
cache_name, cache = self._extract_past_from_model_output(
outputs, standardize_cache_format=standardize_cache_format
)
cache_name, cache = self._extract_past_from_model_output(outputs)
model_kwargs[cache_name] = cache
if getattr(outputs, "state", None) is not None:
model_kwargs["state"] = outputs.state
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment