bys0318 commited on
Commit
23fa792
1 Parent(s): 8291eb8

Support transformers==4.43.0

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