zRzRzRzRzRzRzR
commited on
support transformers 4.47
Browse files- modeling_chatglm.py +2 -4
modeling_chatglm.py
CHANGED
@@ -865,12 +865,10 @@ class ChatGLMForConditionalGeneration(ChatGLMPreTrainedModel):
|
|
865 |
outputs: ModelOutput,
|
866 |
model_kwargs: Dict[str, Any],
|
867 |
is_encoder_decoder: bool = False,
|
868 |
-
standardize_cache_format: bool = False,
|
869 |
) -> Dict[str, Any]:
|
870 |
# update past_key_values
|
871 |
-
|
872 |
-
|
873 |
-
)
|
874 |
|
875 |
# update attention mask
|
876 |
if "attention_mask" in model_kwargs:
|
|
|
865 |
outputs: ModelOutput,
|
866 |
model_kwargs: Dict[str, Any],
|
867 |
is_encoder_decoder: bool = False,
|
|
|
868 |
) -> Dict[str, Any]:
|
869 |
# update past_key_values
|
870 |
+
cache_name, cache = self._extract_past_from_model_output(outputs)
|
871 |
+
model_kwargs[cache_name] = cache
|
|
|
872 |
|
873 |
# update attention mask
|
874 |
if "attention_mask" in model_kwargs:
|