cpatonn commited on
Commit
a03c34b
·
verified ·
1 Parent(s): 061dbce

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +141 -144
README.md CHANGED
@@ -1,144 +1,141 @@
1
- ---
2
- license: mit
3
- language:
4
- - zh
5
- - en
6
- base_model:
7
- - zai-org/GLM-4.5V
8
- pipeline_tag: image-text-to-text
9
- library_name: transformers
10
- ---
11
-
12
- # GLM-4.5V-AWQ-8bit
13
-
14
- ## Method
15
- [vllm-project/llm-compressor](https://github.com/vllm-project/llm-compressor.git) and [neuralmagic/calibration](https://huggingface.co/datasets/neuralmagic/calibration) were used for quantization and calibration.
16
- For configuration information, please visit [config.json](https://huggingface.co/cpatonn/GLM-4.5V-AWQ-8bit/blob/main/config.json).
17
-
18
- ## Inference
19
-
20
- ### Prerequisite
21
- Please install the latest vllm:
22
- ```
23
- pip install -U vllm \
24
- --pre \
25
- --extra-index-url https://wheels.vllm.ai/nightly
26
-
27
- ```
28
-
29
- ### vllm
30
- Please load the model into vllm and sglang as float16 data type for AWQ support and use `tensor_parallel_size <= 2` i.e.,
31
- ```
32
- vllm serve cpatonn/GLM-4.5V-AWQ-8bit \
33
- --dtype float16 \
34
- --tensor-parallel-size 2 \
35
- --pipeline-parallel-size 2 \
36
- --tool-call-parser glm45 \
37
- --reasoning-parser glm45 \
38
- --enable-auto-tool-choice \
39
- --served-model-name glm-4.5v \
40
- --allowed-local-media-path / \
41
- --media-io-kwargs '{"video": {"num_frames": -1}}'
42
- ```
43
-
44
- # GLM-4.5V
45
-
46
- <div align="center">
47
- <img src=https://raw.githubusercontent.com/zai-org/GLM-V/refs/heads/main/resources/logo.svg width="40%"/>
48
- </div>
49
- <p align="center">
50
- 👋 Join our <a href="https://discord.com/invite/8cnQKdAprg" target="_blank">Discord</a> communities.
51
- <br>
52
- 📖 Check out the <a href="https://github.com/zai-org/GLM-V/blob/main/resources/GLM-4.5V_technical_report.pdf" target="_blank">paper</a>.
53
- <br>
54
- 📍 Access the GLM-V series models via API on the <a href="https://docs.z.ai/guides/vlm/glm-4.5v">ZhipuAI Open Platform</a>.
55
- </p>
56
-
57
- ## Introduction
58
-
59
- Vision-language models (VLMs) have become a key cornerstone of intelligent systems. As real-world AI tasks grow increasingly complex, VLMs urgently need to enhance reasoning capabilities beyond basic multimodal perception — improving accuracy, comprehensiveness, and intelligence — to enable complex problem solving, long-context understanding, and multimodal agents.
60
-
61
- Through our open-source work, we aim to explore the technological frontier together with the community while empowering more developers to create exciting and innovative applications.
62
-
63
- GLM-4.5V is based on ZhipuAI’s next-generation flagship text foundation model GLM-4.5-Air (106B parameters, 12B active). It continues the technical approach of GLM-4.1V-Thinking, achieving SOTA performance among models of the same scale on 42 public vision-language benchmarks. It covers common tasks such as image, video, and document understanding, as well as GUI agent operations.
64
-
65
- ![bench_45](https://raw.githubusercontent.com/zai-org/GLM-V/refs/heads/main/resources/bench_45v.jpeg)
66
-
67
- Beyond benchmark performance, GLM-4.5V focuses on real-world usability. Through efficient hybrid training, it can handle diverse types of visual content, enabling full-spectrum vision reasoning, including:
68
- - **Image reasoning** (scene understanding, complex multi-image analysis, spatial recognition)
69
- - **Video understanding** (long video segmentation and event recognition)
70
- - **GUI tasks** (screen reading, icon recognition, desktop operation assistance)
71
- - **Complex chart & long document parsing** (research report analysis, information extraction)
72
- - **Grounding** (precise visual element localization)
73
-
74
- The model also introduces a **Thinking Mode** switch, allowing users to balance between quick responses and deep reasoning. This switch works the same as in the `GLM-4.5` language model.
75
-
76
- ## Quick Start
77
-
78
- Using with transformers:
79
-
80
- ```shell
81
- pip install transformers-v4.55.0-GLM-4.5V-preview
82
- ```
83
-
84
- and then run:
85
-
86
- ```shell
87
- from transformers import AutoProcessor, Glm4vMoeForConditionalGeneration
88
- import torch
89
-
90
- MODEL_PATH = "zai-org/GLM-4.5V"
91
- messages = [
92
- {
93
- "role": "user",
94
- "content": [
95
- {
96
- "type": "image",
97
- "url": "https://upload.wikimedia.org/wikipedia/commons/f/fa/Grayscale_8bits_palette_sample_image.png"
98
- },
99
- {
100
- "type": "text",
101
- "text": "describe this image"
102
- }
103
- ],
104
- }
105
- ]
106
- processor = AutoProcessor.from_pretrained(MODEL_PATH)
107
- model = Glm4vMoeForConditionalGeneration.from_pretrained(
108
- pretrained_model_name_or_path=MODEL_PATH,
109
- torch_dtype="auto",
110
- device_map="auto",
111
- )
112
- inputs = processor.apply_chat_template(
113
- messages,
114
- tokenize=True,
115
- add_generation_prompt=True,
116
- return_dict=True,
117
- return_tensors="pt"
118
- ).to(model.device)
119
- inputs.pop("token_type_ids", None)
120
- generated_ids = model.generate(**inputs, max_new_tokens=8192)
121
- output_text = processor.decode(generated_ids[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False)
122
- print(output_text)
123
- ```
124
-
125
- The special tokens `<|begin_of_box|>` and `<|end_of_box|>` in the response mark the answer’s bounding box in the image. The bounding box is given as four numbers — for example `[x1, y1, x2, y2]`, where `(x1, y1)` is the top-left corner and `(x2, y2`)` is the bottom-right corner. The bracket style may vary ([], [[]], (), <>, etc.), but the meaning is the same: it encloses the coordinates of the box. These coordinates are relative values between 0 and 1000, normalized to the image size.
126
-
127
- For more code information, please visit our [GitHub](https://github.com/zai-org/GLM-V/).
128
-
129
- ## Citation
130
-
131
- If you use this model, please cite the following paper:
132
-
133
- ```bibtex
134
- @misc{glmvteam2025glm41vthinkingversatilemultimodalreasoning,
135
- title={GLM-4.1V-Thinking: Towards Versatile Multimodal Reasoning with Scalable Reinforcement Learning},
136
- author={GLM-V Team and Wenyi Hong and Wenmeng Yu and Xiaotao Gu and Guo Wang and Guobing Gan and Haomiao Tang and Jiale Cheng and Ji Qi and Junhui Ji and Lihang Pan and Shuaiqi Duan and Weihan Wang and Yan Wang and Yean Cheng and Zehai He and Zhe Su and Zhen Yang and Ziyang Pan and Aohan Zeng and Baoxu Wang and Boyan Shi and Changyu Pang and Chenhui Zhang and Da Yin and Fan Yang and Guoqing Chen and Jiazheng Xu and Jiali Chen and Jing Chen and Jinhao Chen and Jinghao Lin and Jinjiang Wang and Junjie Chen and Leqi Lei and Letian Gong and Leyi Pan and Mingzhi Zhang and Qinkai Zheng and Sheng Yang and Shi Zhong and Shiyu Huang and Shuyuan Zhao and Siyan Xue and Shangqin Tu and Shengbiao Meng and Tianshu Zhang and Tianwei Luo and Tianxiang Hao and Wenkai Li and Wei Jia and Xin Lyu and Xuancheng Huang and Yanling Wang and Yadong Xue and Yanfeng Wang and Yifan An and Yifan Du and Yiming Shi and Yiheng Huang and Yilin Niu and Yuan Wang and Yuanchang Yue and Yuchen Li and Yutao Zhang and Yuxuan Zhang and Zhanxiao Du and Zhenyu Hou and Zhao Xue and Zhengxiao Du and Zihan Wang and Peng Zhang and Debing Liu and Bin Xu and Juanzi Li and Minlie Huang and Yuxiao Dong and Jie Tang},
137
- year={2025},
138
- eprint={2507.01006},
139
- archivePrefix={arXiv},
140
- primaryClass={cs.CV},
141
- url={https://arxiv.org/abs/2507.01006},
142
- }
143
- ```
144
-
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - zh
5
+ - en
6
+ base_model:
7
+ - zai-org/GLM-4.5V
8
+ pipeline_tag: image-text-to-text
9
+ library_name: transformers
10
+ ---
11
+
12
+ # GLM-4.5V-AWQ-8bit
13
+
14
+ ## Method
15
+ [vllm-project/llm-compressor](https://github.com/vllm-project/llm-compressor.git) and [neuralmagic/calibration](https://huggingface.co/datasets/neuralmagic/calibration) were used for quantization and calibration.
16
+ For configuration information, please visit [config.json](https://huggingface.co/cpatonn/GLM-4.5V-AWQ-8bit/blob/main/config.json).
17
+
18
+ ## Inference
19
+
20
+ ### Prerequisite
21
+ Install the latest vllm releases:
22
+ ```
23
+ pip install -U vllm
24
+ ```
25
+
26
+ ### vllm
27
+ Please load the model into vllm and sglang as float16 data type for AWQ support and use `tensor_parallel_size <= 2` i.e.,
28
+ ```
29
+ vllm serve cpatonn/GLM-4.5V-AWQ-8bit \
30
+ --dtype float16 \
31
+ --tensor-parallel-size 2 \
32
+ --pipeline-parallel-size 2 \
33
+ --tool-call-parser glm45 \
34
+ --reasoning-parser glm45 \
35
+ --enable-auto-tool-choice \
36
+ --served-model-name glm-4.5v \
37
+ --allowed-local-media-path / \
38
+ --media-io-kwargs '{"video": {"num_frames": -1}}'
39
+ ```
40
+
41
+ # GLM-4.5V
42
+
43
+ <div align="center">
44
+ <img src=https://raw.githubusercontent.com/zai-org/GLM-V/refs/heads/main/resources/logo.svg width="40%"/>
45
+ </div>
46
+ <p align="center">
47
+ 👋 Join our <a href="https://discord.com/invite/8cnQKdAprg" target="_blank">Discord</a> communities.
48
+ <br>
49
+ 📖 Check out the <a href="https://github.com/zai-org/GLM-V/blob/main/resources/GLM-4.5V_technical_report.pdf" target="_blank">paper</a>.
50
+ <br>
51
+ 📍 Access the GLM-V series models via API on the <a href="https://docs.z.ai/guides/vlm/glm-4.5v">ZhipuAI Open Platform</a>.
52
+ </p>
53
+
54
+ ## Introduction
55
+
56
+ Vision-language models (VLMs) have become a key cornerstone of intelligent systems. As real-world AI tasks grow increasingly complex, VLMs urgently need to enhance reasoning capabilities beyond basic multimodal perception — improving accuracy, comprehensiveness, and intelligence — to enable complex problem solving, long-context understanding, and multimodal agents.
57
+
58
+ Through our open-source work, we aim to explore the technological frontier together with the community while empowering more developers to create exciting and innovative applications.
59
+
60
+ GLM-4.5V is based on ZhipuAI’s next-generation flagship text foundation model GLM-4.5-Air (106B parameters, 12B active). It continues the technical approach of GLM-4.1V-Thinking, achieving SOTA performance among models of the same scale on 42 public vision-language benchmarks. It covers common tasks such as image, video, and document understanding, as well as GUI agent operations.
61
+
62
+ ![bench_45](https://raw.githubusercontent.com/zai-org/GLM-V/refs/heads/main/resources/bench_45v.jpeg)
63
+
64
+ Beyond benchmark performance, GLM-4.5V focuses on real-world usability. Through efficient hybrid training, it can handle diverse types of visual content, enabling full-spectrum vision reasoning, including:
65
+ - **Image reasoning** (scene understanding, complex multi-image analysis, spatial recognition)
66
+ - **Video understanding** (long video segmentation and event recognition)
67
+ - **GUI tasks** (screen reading, icon recognition, desktop operation assistance)
68
+ - **Complex chart & long document parsing** (research report analysis, information extraction)
69
+ - **Grounding** (precise visual element localization)
70
+
71
+ The model also introduces a **Thinking Mode** switch, allowing users to balance between quick responses and deep reasoning. This switch works the same as in the `GLM-4.5` language model.
72
+
73
+ ## Quick Start
74
+
75
+ Using with transformers:
76
+
77
+ ```shell
78
+ pip install transformers-v4.55.0-GLM-4.5V-preview
79
+ ```
80
+
81
+ and then run:
82
+
83
+ ```shell
84
+ from transformers import AutoProcessor, Glm4vMoeForConditionalGeneration
85
+ import torch
86
+
87
+ MODEL_PATH = "zai-org/GLM-4.5V"
88
+ messages = [
89
+ {
90
+ "role": "user",
91
+ "content": [
92
+ {
93
+ "type": "image",
94
+ "url": "https://upload.wikimedia.org/wikipedia/commons/f/fa/Grayscale_8bits_palette_sample_image.png"
95
+ },
96
+ {
97
+ "type": "text",
98
+ "text": "describe this image"
99
+ }
100
+ ],
101
+ }
102
+ ]
103
+ processor = AutoProcessor.from_pretrained(MODEL_PATH)
104
+ model = Glm4vMoeForConditionalGeneration.from_pretrained(
105
+ pretrained_model_name_or_path=MODEL_PATH,
106
+ torch_dtype="auto",
107
+ device_map="auto",
108
+ )
109
+ inputs = processor.apply_chat_template(
110
+ messages,
111
+ tokenize=True,
112
+ add_generation_prompt=True,
113
+ return_dict=True,
114
+ return_tensors="pt"
115
+ ).to(model.device)
116
+ inputs.pop("token_type_ids", None)
117
+ generated_ids = model.generate(**inputs, max_new_tokens=8192)
118
+ output_text = processor.decode(generated_ids[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False)
119
+ print(output_text)
120
+ ```
121
+
122
+ The special tokens `<|begin_of_box|>` and `<|end_of_box|>` in the response mark the answer’s bounding box in the image. The bounding box is given as four numbers — for example `[x1, y1, x2, y2]`, where `(x1, y1)` is the top-left corner and `(x2, y2`)` is the bottom-right corner. The bracket style may vary ([], [[]], (), <>, etc.), but the meaning is the same: it encloses the coordinates of the box. These coordinates are relative values between 0 and 1000, normalized to the image size.
123
+
124
+ For more code information, please visit our [GitHub](https://github.com/zai-org/GLM-V/).
125
+
126
+ ## Citation
127
+
128
+ If you use this model, please cite the following paper:
129
+
130
+ ```bibtex
131
+ @misc{glmvteam2025glm41vthinkingversatilemultimodalreasoning,
132
+ title={GLM-4.1V-Thinking: Towards Versatile Multimodal Reasoning with Scalable Reinforcement Learning},
133
+ author={GLM-V Team and Wenyi Hong and Wenmeng Yu and Xiaotao Gu and Guo Wang and Guobing Gan and Haomiao Tang and Jiale Cheng and Ji Qi and Junhui Ji and Lihang Pan and Shuaiqi Duan and Weihan Wang and Yan Wang and Yean Cheng and Zehai He and Zhe Su and Zhen Yang and Ziyang Pan and Aohan Zeng and Baoxu Wang and Boyan Shi and Changyu Pang and Chenhui Zhang and Da Yin and Fan Yang and Guoqing Chen and Jiazheng Xu and Jiali Chen and Jing Chen and Jinhao Chen and Jinghao Lin and Jinjiang Wang and Junjie Chen and Leqi Lei and Letian Gong and Leyi Pan and Mingzhi Zhang and Qinkai Zheng and Sheng Yang and Shi Zhong and Shiyu Huang and Shuyuan Zhao and Siyan Xue and Shangqin Tu and Shengbiao Meng and Tianshu Zhang and Tianwei Luo and Tianxiang Hao and Wenkai Li and Wei Jia and Xin Lyu and Xuancheng Huang and Yanling Wang and Yadong Xue and Yanfeng Wang and Yifan An and Yifan Du and Yiming Shi and Yiheng Huang and Yilin Niu and Yuan Wang and Yuanchang Yue and Yuchen Li and Yutao Zhang and Yuxuan Zhang and Zhanxiao Du and Zhenyu Hou and Zhao Xue and Zhengxiao Du and Zihan Wang and Peng Zhang and Debing Liu and Bin Xu and Juanzi Li and Minlie Huang and Yuxiao Dong and Jie Tang},
134
+ year={2025},
135
+ eprint={2507.01006},
136
+ archivePrefix={arXiv},
137
+ primaryClass={cs.CV},
138
+ url={https://arxiv.org/abs/2507.01006},
139
+ }
140
+ ```
141
+