zR
commited on
Commit
·
01328fa
1
Parent(s):
9a7a028
support transformers 4.44
Browse files- README.md +2 -0
- README_en.md +2 -0
- config.json +1 -1
- generation_config.json +1 -1
- modeling_chatglm.py +1 -4
README.md
CHANGED
|
@@ -19,6 +19,8 @@ inference: false
|
|
| 19 |
|
| 20 |
Read this in [English](README_en.md)
|
| 21 |
|
|
|
|
|
|
|
| 22 |
GLM-4V-9B 是智谱 AI 推出的最新一代预训练模型 GLM-4 系列中的开源多模态版本。
|
| 23 |
**GLM-4V-9B** 具备 1120 * 1120 高分辨率下的中英双语多轮对话能力,在中英文综合能力、感知推理、文字识别、图表理解等多方面多模态评测中,GLM-4V-9B 表现出超越 GPT-4-turbo-2024-04-09、Gemini
|
| 24 |
1.0 Pro、Qwen-VL-Max 和 Claude 3 Opus 的卓越性能。
|
|
|
|
| 19 |
|
| 20 |
Read this in [English](README_en.md)
|
| 21 |
|
| 22 |
+
**2024/08/12, 本仓库代码已更新并使用 `transforemrs>=4.44.0`, 请及时更新依赖。**
|
| 23 |
+
|
| 24 |
GLM-4V-9B 是智谱 AI 推出的最新一代预训练模型 GLM-4 系列中的开源多模态版本。
|
| 25 |
**GLM-4V-9B** 具备 1120 * 1120 高分辨率下的中英双语多轮对话能力,在中英文综合能力、感知推理、文字识别、图表理解等多方面多模态评测中,GLM-4V-9B 表现出超越 GPT-4-turbo-2024-04-09、Gemini
|
| 26 |
1.0 Pro、Qwen-VL-Max 和 Claude 3 Opus 的卓越性能。
|
README_en.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
# GLM-4V-9B
|
| 2 |
|
|
|
|
|
|
|
| 3 |
GLM-4V-9B is an open source multimodal version of the latest generation of pre-trained models in the GLM-4 series launched by Zhipu AI.
|
| 4 |
**GLM-4V-9B** has the ability to conduct multi-round conversations in Chinese and English at a high resolution of 1120 * 1120. In multimodal evaluations of comprehensive Chinese and English abilities, perceptual reasoning, text recognition, and chart understanding, GLM-4V-9B has shown superior performance over GPT-4-turbo-2024-04-09, Gemini
|
| 5 |
1.0 Pro, Qwen-VL-Max, and Claude 3 Opus.
|
|
|
|
| 1 |
# GLM-4V-9B
|
| 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 |
GLM-4V-9B is an open source multimodal version of the latest generation of pre-trained models in the GLM-4 series launched by Zhipu AI.
|
| 6 |
**GLM-4V-9B** has the ability to conduct multi-round conversations in Chinese and English at a high resolution of 1120 * 1120. In multimodal evaluations of comprehensive Chinese and English abilities, perceptual reasoning, text recognition, and chart understanding, GLM-4V-9B has shown superior performance over GPT-4-turbo-2024-04-09, Gemini
|
| 7 |
1.0 Pro, Qwen-VL-Max, and Claude 3 Opus.
|
config.json
CHANGED
|
@@ -50,7 +50,7 @@
|
|
| 50 |
"seq_length": 8192,
|
| 51 |
"use_cache": true,
|
| 52 |
"torch_dtype": "bfloat16",
|
| 53 |
-
"transformers_version": "4.
|
| 54 |
"tie_word_embeddings": false,
|
| 55 |
"eos_token_id": [151329, 151336, 151338],
|
| 56 |
"pad_token_id": 151329,
|
|
|
|
| 50 |
"seq_length": 8192,
|
| 51 |
"use_cache": true,
|
| 52 |
"torch_dtype": "bfloat16",
|
| 53 |
+
"transformers_version": "4.44.0",
|
| 54 |
"tie_word_embeddings": false,
|
| 55 |
"eos_token_id": [151329, 151336, 151338],
|
| 56 |
"pad_token_id": 151329,
|
generation_config.json
CHANGED
|
@@ -9,5 +9,5 @@
|
|
| 9 |
"temperature": 0.8,
|
| 10 |
"max_length": 8192,
|
| 11 |
"top_p": 0.8,
|
| 12 |
-
"transformers_version": "4.
|
| 13 |
}
|
|
|
|
| 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
|
|
|
|
| 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
|