Text Generation
Transformers
Safetensors
chatglm
feature-extraction
custom_code
JosephusCheung commited on
Commit
2e73503
·
verified ·
1 Parent(s): 4b6187a

Upload 7 files

Browse files
Files changed (2) hide show
  1. generation_config.json +4 -4
  2. modeling_chatglm.py +2 -5
generation_config.json CHANGED
@@ -1,13 +1,13 @@
1
  {
2
- "do_sample": true,
3
  "eos_token_id": [
4
  151329,
5
  151336,
6
  151338
7
  ],
8
- "max_length": 8192,
9
  "pad_token_id": 151329,
 
10
  "temperature": 0.8,
 
11
  "top_p": 0.8,
12
- "transformers_version": "4.43.1"
13
- }
 
1
  {
 
2
  "eos_token_id": [
3
  151329,
4
  151336,
5
  151338
6
  ],
 
7
  "pad_token_id": 151329,
8
+ "do_sample": true,
9
  "temperature": 0.8,
10
+ "max_length": 8192,
11
  "top_p": 0.8,
12
+ "transformers_version": "4.44.0"
13
+ }
modeling_chatglm.py CHANGED
@@ -1082,12 +1082,9 @@ class ChatGLMForConditionalGeneration(ChatGLMPreTrainedModel):
1082
  outputs: ModelOutput,
1083
  model_kwargs: Dict[str, Any],
1084
  is_encoder_decoder: bool = False,
1085
- standardize_cache_format: bool = False,
1086
  ) -> Dict[str, Any]:
1087
  # update past_key_values
1088
- cache_name, cache = self._extract_past_from_model_output(
1089
- outputs, standardize_cache_format=standardize_cache_format
1090
- )
1091
  model_kwargs[cache_name] = cache
1092
 
1093
  # update attention mask
@@ -1329,4 +1326,4 @@ class ChatGLMForSequenceClassification(ChatGLMPreTrainedModel):
1329
  past_key_values=transformer_outputs.past_key_values,
1330
  hidden_states=transformer_outputs.hidden_states,
1331
  attentions=transformer_outputs.attentions,
1332
- )
 
1082
  outputs: ModelOutput,
1083
  model_kwargs: Dict[str, Any],
1084
  is_encoder_decoder: bool = False,
 
1085
  ) -> Dict[str, Any]:
1086
  # update past_key_values
1087
+ cache_name, cache = self._extract_past_from_model_output(outputs)
 
 
1088
  model_kwargs[cache_name] = cache
1089
 
1090
  # update attention mask
 
1326
  past_key_values=transformer_outputs.past_key_values,
1327
  hidden_states=transformer_outputs.hidden_states,
1328
  attentions=transformer_outputs.attentions,
1329
+ )