zRzRzRzRzRzRzR commited on
Commit
548388c
·
verified ·
1 Parent(s): d93643f

support transformers 4.47

Browse files
Files changed (1) hide show
  1. 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
- model_kwargs["past_key_values"] = self._extract_past_from_model_output(
872
- outputs, standardize_cache_format=standardize_cache_format
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: