zRzRzRzRzRzRzR commited on
Commit
aae8bd7
1 Parent(s): c24133c

support transformers 4.44

Browse files
Files changed (5) hide show
  1. README.md +2 -0
  2. README_en.md +2 -0
  3. config.json +1 -1
  4. generation_config.json +1 -1
  5. modeling_chatglm.py +1 -4
README.md CHANGED
@@ -16,6 +16,8 @@ inference: false
16
 
17
  Read this in [English](README_en.md).
18
 
 
 
19
  **2024/07/24,我们发布了与长文本相关的最新技术解读,关注 [这里](https://medium.com/@ChatGLM/glm-long-scaling-pre-trained-model-contexts-to-millions-caa3c48dea85) 查看我们在训练 GLM-4-9B 开源模型中关于长文本技术的技术报告**
20
 
21
  ## 模型介绍
 
16
 
17
  Read this in [English](README_en.md).
18
 
19
+ **2024/08/12, 本仓库代码已更新并使用 `transforemrs>=4.44.0`, 请及时更新依赖。**
20
+
21
  **2024/07/24,我们发布了与长文本相关的最新技术解读,关注 [这里](https://medium.com/@ChatGLM/glm-long-scaling-pre-trained-model-contexts-to-millions-caa3c48dea85) 查看我们在训练 GLM-4-9B 开源模型中关于长文本技术的技术报告**
22
 
23
  ## 模型介绍
README_en.md CHANGED
@@ -1,5 +1,7 @@
1
  # GLM-4-9B-Chat
2
 
 
 
3
  **On July 24, 2024, we released the latest technical interpretation related to long texts. Check
4
  out [here](https://medium.com/@ChatGLM/glm-long-scaling-pre-trained-model-contexts-to-millions-caa3c48dea85) to view our
5
  technical report on long context technology in the training of the open-source GLM-4-9B model.**
 
1
  # GLM-4-9B-Chat
2
 
3
+ **2024/08/12, The repository code has been updated and now requires `transformers>=4.44.0`. Please update your dependencies accordingly.**
4
+
5
  **On July 24, 2024, we released the latest technical interpretation related to long texts. Check
6
  out [here](https://medium.com/@ChatGLM/glm-long-scaling-pre-trained-model-contexts-to-millions-caa3c48dea85) to view our
7
  technical report on long context technology in the training of the open-source GLM-4-9B model.**
config.json CHANGED
@@ -38,7 +38,7 @@
38
  "seq_length": 131072,
39
  "use_cache": true,
40
  "torch_dtype": "bfloat16",
41
- "transformers_version": "4.42.4",
42
  "tie_word_embeddings": false,
43
  "eos_token_id": [151329, 151336, 151338],
44
  "pad_token_id": 151329
 
38
  "seq_length": 131072,
39
  "use_cache": true,
40
  "torch_dtype": "bfloat16",
41
+ "transformers_version": "4.44.0",
42
  "tie_word_embeddings": false,
43
  "eos_token_id": [151329, 151336, 151338],
44
  "pad_token_id": 151329
generation_config.json CHANGED
@@ -9,5 +9,5 @@
9
  "temperature": 0.8,
10
  "max_length": 128000,
11
  "top_p": 0.8,
12
- "transformers_version": "4.42.4"
13
  }
 
9
  "temperature": 0.8,
10
  "max_length": 128000,
11
  "top_p": 0.8,
12
+ "transformers_version": "4.44.0"
13
  }
modeling_chatglm.py CHANGED
@@ -924,12 +924,9 @@ class ChatGLMForConditionalGeneration(ChatGLMPreTrainedModel):
924
  outputs: ModelOutput,
925
  model_kwargs: Dict[str, Any],
926
  is_encoder_decoder: bool = False,
927
- standardize_cache_format: bool = False,
928
  ) -> Dict[str, Any]:
929
  # update past_key_values
930
- cache_name, cache = self._extract_past_from_model_output(
931
- outputs, standardize_cache_format=standardize_cache_format
932
- )
933
  model_kwargs[cache_name] = cache
934
 
935
  # update attention mask
 
924
  outputs: ModelOutput,
925
  model_kwargs: Dict[str, Any],
926
  is_encoder_decoder: bool = False,
 
927
  ) -> Dict[str, Any]:
928
  # update past_key_values
929
+ cache_name, cache = self._extract_past_from_model_output(outputs)
 
 
930
  model_kwargs[cache_name] = cache
931
 
932
  # update attention mask