Support transformers==4.43.0
Browse files- modeling_chatglm.py +2 -4
modeling_chatglm.py
CHANGED
@@ -734,12 +734,10 @@ class ChatGLMForConditionalGeneration(ChatGLMPreTrainedModel):
|
|
734 |
outputs: ModelOutput,
|
735 |
model_kwargs: Dict[str, Any],
|
736 |
is_encoder_decoder: bool = False,
|
737 |
-
standardize_cache_format: bool = False,
|
738 |
) -> Dict[str, Any]:
|
739 |
# update past_key_values
|
740 |
-
|
741 |
-
|
742 |
-
)
|
743 |
|
744 |
# update attention mask
|
745 |
if "attention_mask" in model_kwargs:
|
|
|
734 |
outputs: ModelOutput,
|
735 |
model_kwargs: Dict[str, Any],
|
736 |
is_encoder_decoder: bool = False,
|
|
|
737 |
) -> Dict[str, Any]:
|
738 |
# update past_key_values
|
739 |
+
cache_name, cache = self._extract_past_from_model_output(outputs)
|
740 |
+
model_kwargs[cache_name] = cache
|
|
|
741 |
|
742 |
# update attention mask
|
743 |
if "attention_mask" in model_kwargs:
|