Fremko commited on
Commit
d354b3e
·
verified ·
1 Parent(s): d176c03

(Trained with Unsloth)

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
chat_template.jinja ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [gMASK]<sop>
2
+ {%- for msg in messages %}
3
+ {%- if msg.role == 'system' %}
4
+ <|system|>
5
+ {{ msg.content }}
6
+ {%- elif msg.role == 'user' %}
7
+ <|user|>{{ '\n' }}
8
+
9
+ {%- if msg.content is string %}
10
+ {{ msg.content }}
11
+ {%- else %}
12
+ {%- for item in msg.content %}
13
+ {%- if item.type == 'video' or 'video' in item %}
14
+ <|begin_of_video|><|video|><|end_of_video|>
15
+ {%- elif item.type == 'image' or 'image' in item %}
16
+ <|begin_of_image|><|image|><|end_of_image|>
17
+ {%- elif item.type == 'text' %}
18
+ {{ item.text }}
19
+ {%- endif %}
20
+ {%- endfor %}
21
+ {%- endif %}
22
+ {%- elif msg.role == 'assistant' %}
23
+ {%- if msg.metadata %}
24
+ <|assistant|>{{ msg.metadata }}
25
+ {{ msg.content }}
26
+ {%- else %}
27
+ <|assistant|>
28
+ {{ msg.content }}
29
+ {%- endif %}
30
+ {%- endif %}
31
+ {%- endfor %}
32
+ {% if add_generation_prompt %}<|assistant|>
33
+ {% endif %}
config.json ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Glm4vForConditionalGeneration"
4
+ ],
5
+ "attention_bias": true,
6
+ "attention_dropout": 0.0,
7
+ "eos_token_id": [
8
+ 151329,
9
+ 151336,
10
+ 151338,
11
+ 151348
12
+ ],
13
+ "hidden_act": "silu",
14
+ "hidden_size": 4096,
15
+ "image_end_token_id": 151340,
16
+ "image_start_token_id": 151339,
17
+ "image_token_id": 151343,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 13696,
20
+ "max_position_embeddings": 65536,
21
+ "model_type": "glm4v",
22
+ "num_attention_heads": 32,
23
+ "num_hidden_layers": 40,
24
+ "num_key_value_heads": 2,
25
+ "pad_token_id": 151352,
26
+ "partial_rotary_factor": 0.5,
27
+ "rms_norm_eps": 1e-05,
28
+ "rope_scaling": {
29
+ "mrope_section": [
30
+ 8,
31
+ 12,
32
+ 12
33
+ ],
34
+ "rope_type": "default",
35
+ "type": "default"
36
+ },
37
+ "rope_theta": 10000.0,
38
+ "text_config": {
39
+ "architectures": [
40
+ "Glm4vForConditionalGeneration"
41
+ ],
42
+ "attention_bias": true,
43
+ "attention_dropout": 0.0,
44
+ "eos_token_id": [
45
+ 151329,
46
+ 151336,
47
+ 151338,
48
+ 151348
49
+ ],
50
+ "hidden_act": "silu",
51
+ "hidden_size": 4096,
52
+ "image_token_id": null,
53
+ "initializer_range": 0.02,
54
+ "intermediate_size": 13696,
55
+ "max_position_embeddings": 65536,
56
+ "model_type": "glm4v_text",
57
+ "num_attention_heads": 32,
58
+ "num_hidden_layers": 40,
59
+ "num_key_value_heads": 2,
60
+ "pad_token_id": 151329,
61
+ "partial_rotary_factor": 0.5,
62
+ "rms_norm_eps": 1e-05,
63
+ "rope_scaling": {
64
+ "mrope_section": [
65
+ 8,
66
+ 12,
67
+ 12
68
+ ],
69
+ "rope_type": "default",
70
+ "type": "default"
71
+ },
72
+ "rope_theta": 10000.0,
73
+ "torch_dtype": "bfloat16",
74
+ "use_cache": true,
75
+ "video_token_id": null,
76
+ "vocab_size": 151552
77
+ },
78
+ "tie_word_embeddings": false,
79
+ "torch_dtype": "bfloat16",
80
+ "transformers_version": "4.55.4",
81
+ "unsloth_version": "2025.10.3",
82
+ "use_cache": true,
83
+ "video_end_token_id": 151342,
84
+ "video_start_token_id": 151341,
85
+ "video_token_id": 151344,
86
+ "vision_config": {
87
+ "attention_bias": false,
88
+ "attention_dropout": 0.0,
89
+ "depth": 24,
90
+ "hidden_act": "silu",
91
+ "hidden_dropout_prob": 0.0,
92
+ "hidden_size": 1536,
93
+ "image_size": 336,
94
+ "in_channels": 3,
95
+ "initializer_range": 0.02,
96
+ "intermediate_size": 13696,
97
+ "model_type": "glm4v",
98
+ "num_heads": 12,
99
+ "out_hidden_size": 4096,
100
+ "patch_size": 14,
101
+ "rms_norm_eps": 1e-05,
102
+ "spatial_merge_size": 2,
103
+ "temporal_patch_size": 2,
104
+ "torch_dtype": "bfloat16"
105
+ },
106
+ "vocab_size": 151552
107
+ }
preprocessor_config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_convert_rgb": true,
3
+ "do_normalize": true,
4
+ "do_rescale": true,
5
+ "do_resize": true,
6
+ "image_mean": [
7
+ 0.48145466,
8
+ 0.4578275,
9
+ 0.40821073
10
+ ],
11
+ "image_processor_type": "Glm4vImageProcessor",
12
+ "image_std": [
13
+ 0.26862954,
14
+ 0.26130258,
15
+ 0.27577711
16
+ ],
17
+ "merge_size": 2,
18
+ "patch_size": 14,
19
+ "processor_class": "Glm4vProcessor",
20
+ "resample": 3,
21
+ "rescale_factor": 0.00392156862745098,
22
+ "size": {
23
+ "longest_edge": 11760000,
24
+ "shortest_edge": 12544
25
+ },
26
+ "temporal_patch_size": 2
27
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|endoftext|>",
4
+ "[MASK]",
5
+ "[gMASK]",
6
+ "[sMASK]",
7
+ "<sop>",
8
+ "<eop>",
9
+ "<|system|>",
10
+ "<|user|>",
11
+ "<|assistant|>",
12
+ "<|observation|>",
13
+ "<|begin_of_image|>",
14
+ "<|end_of_image|>",
15
+ "<|begin_of_video|>",
16
+ "<|end_of_video|>",
17
+ "<|image|>",
18
+ "<|video|>"
19
+ ],
20
+ "eos_token": {
21
+ "content": "<|endoftext|>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false
26
+ },
27
+ "pad_token": "<|PAD_TOKEN|>"
28
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccfc12ad4b16454b891bb3633b44de189c915d43fb060466d05005037083a987
3
+ size 19968640
tokenizer_config.json ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "151329": {
4
+ "content": "<|endoftext|>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "151330": {
12
+ "content": "[MASK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "151331": {
20
+ "content": "[gMASK]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "151332": {
28
+ "content": "[sMASK]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "151333": {
36
+ "content": "<sop>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "151334": {
44
+ "content": "<eop>",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ },
51
+ "151335": {
52
+ "content": "<|system|>",
53
+ "lstrip": false,
54
+ "normalized": false,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": true
58
+ },
59
+ "151336": {
60
+ "content": "<|user|>",
61
+ "lstrip": false,
62
+ "normalized": false,
63
+ "rstrip": false,
64
+ "single_word": false,
65
+ "special": true
66
+ },
67
+ "151337": {
68
+ "content": "<|assistant|>",
69
+ "lstrip": false,
70
+ "normalized": false,
71
+ "rstrip": false,
72
+ "single_word": false,
73
+ "special": true
74
+ },
75
+ "151338": {
76
+ "content": "<|observation|>",
77
+ "lstrip": false,
78
+ "normalized": false,
79
+ "rstrip": false,
80
+ "single_word": false,
81
+ "special": true
82
+ },
83
+ "151339": {
84
+ "content": "<|begin_of_image|>",
85
+ "lstrip": false,
86
+ "normalized": false,
87
+ "rstrip": false,
88
+ "single_word": false,
89
+ "special": true
90
+ },
91
+ "151340": {
92
+ "content": "<|end_of_image|>",
93
+ "lstrip": false,
94
+ "normalized": false,
95
+ "rstrip": false,
96
+ "single_word": false,
97
+ "special": true
98
+ },
99
+ "151341": {
100
+ "content": "<|begin_of_video|>",
101
+ "lstrip": false,
102
+ "normalized": false,
103
+ "rstrip": false,
104
+ "single_word": false,
105
+ "special": true
106
+ },
107
+ "151342": {
108
+ "content": "<|end_of_video|>",
109
+ "lstrip": false,
110
+ "normalized": false,
111
+ "rstrip": false,
112
+ "single_word": false,
113
+ "special": true
114
+ },
115
+ "151343": {
116
+ "content": "<|image|>",
117
+ "lstrip": false,
118
+ "normalized": false,
119
+ "rstrip": false,
120
+ "single_word": false,
121
+ "special": true
122
+ },
123
+ "151344": {
124
+ "content": "<|video|>",
125
+ "lstrip": false,
126
+ "normalized": false,
127
+ "rstrip": false,
128
+ "single_word": false,
129
+ "special": true
130
+ },
131
+ "151345": {
132
+ "content": "<think>",
133
+ "lstrip": false,
134
+ "normalized": false,
135
+ "rstrip": false,
136
+ "single_word": false,
137
+ "special": false
138
+ },
139
+ "151346": {
140
+ "content": "</think>",
141
+ "lstrip": false,
142
+ "normalized": false,
143
+ "rstrip": false,
144
+ "single_word": false,
145
+ "special": false
146
+ },
147
+ "151347": {
148
+ "content": "<answer>",
149
+ "lstrip": false,
150
+ "normalized": false,
151
+ "rstrip": false,
152
+ "single_word": false,
153
+ "special": true
154
+ },
155
+ "151348": {
156
+ "content": "</answer>",
157
+ "lstrip": false,
158
+ "normalized": false,
159
+ "rstrip": false,
160
+ "single_word": false,
161
+ "special": false
162
+ },
163
+ "151349": {
164
+ "content": "<|begin_of_box|>",
165
+ "lstrip": false,
166
+ "normalized": false,
167
+ "rstrip": false,
168
+ "single_word": false,
169
+ "special": false
170
+ },
171
+ "151350": {
172
+ "content": "<|end_of_box|>",
173
+ "lstrip": false,
174
+ "normalized": false,
175
+ "rstrip": false,
176
+ "single_word": false,
177
+ "special": false
178
+ },
179
+ "151351": {
180
+ "content": "<|sep|>",
181
+ "lstrip": false,
182
+ "normalized": false,
183
+ "rstrip": false,
184
+ "single_word": false,
185
+ "special": false
186
+ },
187
+ "151352": {
188
+ "content": "<|PAD_TOKEN|>",
189
+ "lstrip": false,
190
+ "normalized": false,
191
+ "rstrip": false,
192
+ "single_word": false,
193
+ "special": true
194
+ }
195
+ },
196
+ "additional_special_tokens": [
197
+ "<|endoftext|>",
198
+ "[MASK]",
199
+ "[gMASK]",
200
+ "[sMASK]",
201
+ "<sop>",
202
+ "<eop>",
203
+ "<|system|>",
204
+ "<|user|>",
205
+ "<|assistant|>",
206
+ "<|observation|>",
207
+ "<|begin_of_image|>",
208
+ "<|end_of_image|>",
209
+ "<|begin_of_video|>",
210
+ "<|end_of_video|>",
211
+ "<|image|>",
212
+ "<|video|>"
213
+ ],
214
+ "clean_up_tokenization_spaces": false,
215
+ "do_lower_case": false,
216
+ "eos_token": "<|endoftext|>",
217
+ "extra_special_tokens": {},
218
+ "model_input_names": [
219
+ "input_ids",
220
+ "attention_mask"
221
+ ],
222
+ "model_max_length": 65536,
223
+ "pad_token": "<|PAD_TOKEN|>",
224
+ "padding_side": "right",
225
+ "processor_class": "Glm4vProcessor",
226
+ "remove_space": false,
227
+ "tokenizer_class": "PreTrainedTokenizerFast",
228
+ "chat_template": "[gMASK]<sop>\n{%- for msg in messages %}\n {%- if msg.role == 'system' %}\n<|system|>\n{{ msg.content }}\n {%- elif msg.role == 'user' %}\n<|user|>{{ '\\n' }}\n\n {%- if msg.content is string %}\n{{ msg.content }}\n {%- else %}\n {%- for item in msg.content %}\n {%- if item.type == 'video' or 'video' in item %}\n<|begin_of_video|><|video|><|end_of_video|>\n {%- elif item.type == 'image' or 'image' in item %}\n<|begin_of_image|><|image|><|end_of_image|>\n {%- elif item.type == 'text' %}\n{{ item.text }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {%- elif msg.role == 'assistant' %}\n {%- if msg.metadata %}\n<|assistant|>{{ msg.metadata }}\n{{ msg.content }}\n {%- else %}\n<|assistant|>\n{{ msg.content }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{% if add_generation_prompt %}<|assistant|>\n{% endif %}"
229
+ }
video_preprocessor_config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": null,
3
+ "data_format": "channels_first",
4
+ "default_to_square": true,
5
+ "device": null,
6
+ "do_center_crop": null,
7
+ "do_convert_rgb": true,
8
+ "do_normalize": true,
9
+ "do_pad": null,
10
+ "do_rescale": true,
11
+ "do_resize": true,
12
+ "do_sample_frames": true,
13
+ "fps": 2,
14
+ "image_mean": [
15
+ 0.48145466,
16
+ 0.4578275,
17
+ 0.40821073
18
+ ],
19
+ "image_std": [
20
+ 0.26862954,
21
+ 0.26130258,
22
+ 0.27577711
23
+ ],
24
+ "input_data_format": null,
25
+ "max_image_size": {
26
+ "longest_edge": 47040000
27
+ },
28
+ "merge_size": 2,
29
+ "num_frames": 16,
30
+ "patch_size": 14,
31
+ "processor_class": "Glm4vProcessor",
32
+ "resample": 3,
33
+ "rescale_factor": 0.00392156862745098,
34
+ "size": {
35
+ "longest_edge": 47040000,
36
+ "shortest_edge": 12544
37
+ },
38
+ "size_divisor": null,
39
+ "temporal_patch_size": 2,
40
+ "video_metadata": null,
41
+ "video_processor_type": "Glm4vVideoProcessor"
42
+ }