yujiepan commited on
Commit
9018dbd
·
verified ·
1 Parent(s): 85dd4d1

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ 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
+ processor/tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ tokenizer/tokenizer.json filter=lfs diff=lfs merge=lfs -text
.meta.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "diffusers": "0.40.0.dev0",
3
+ "torch": "2.13.0+cu126",
4
+ "transformers": "5.15.0.dev0"
5
+ }
README.md ADDED
@@ -0,0 +1,355 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: diffusers
3
+ pipeline_tag: image-text-to-video
4
+ base_model:
5
+ - MiniMaxAI/MiniMax-H3
6
+ ---
7
+
8
+ This tiny model is for debugging. It is randomly initialized with the config adapted from [MiniMaxAI/MiniMax-H3](https://huggingface.co/MiniMaxAI/MiniMax-H3).
9
+
10
+ File size:
11
+ - ~12MB text_encoder/model.safetensors
12
+ - ~0.5MB transformer/diffusion_pytorch_model.safetensors
13
+ - ~0.5MB transformer_ref/diffusion_pytorch_model.safetensors
14
+ - ~4MB vae/diffusion_pytorch_model.safetensors
15
+ - ~64MB audio_vae/diffusion_pytorch_model.safetensors
16
+
17
+ Requires `diffusers` from source (`main`) with MiniMax-H3 modular blocks, and a recent `transformers` that ships `Qwen3VLForConditionalGeneration`.
18
+
19
+ Notes:
20
+ - The conditioner must have `num_hidden_layers > 50` because MiniMax-H3 reads `hidden_states[50]`.
21
+ - Transformer RoPE needs `attention_head_dim >= 6 * rope_freq_dim`.
22
+ - Audio VAE decoder needs `decoder_dim >= 128` for the released 7-stage upsample stack.
23
+
24
+ | File path | Size |
25
+ |------|------|
26
+ | audio_vae/diffusion_pytorch_model.safetensors | 66.7MB |
27
+ | text_encoder/model.safetensors | 12.1MB |
28
+ | transformer/diffusion_pytorch_model.safetensors | 0.5MB |
29
+ | transformer_ref/diffusion_pytorch_model.safetensors | 0.5MB |
30
+ | vae/diffusion_pytorch_model.safetensors | 4.5MB |
31
+
32
+
33
+ ### Example usage:
34
+
35
+ ```python
36
+ import torch
37
+ from diffusers import ModularPipeline
38
+
39
+ model_id = "tiny-random/minimax-h3"
40
+ device = 'cuda' if torch.cuda.is_available() else 'cpu'
41
+ pipe = ModularPipeline.from_pretrained(model_id, workflow='t2va')
42
+ pipe.load_components(dtype=torch.bfloat16)
43
+ if device == 'cuda':
44
+ pipe.to(device)
45
+
46
+ outputs = pipe(
47
+ prompt='A red fox trotting through a snowy pine forest',
48
+ num_frames=124,
49
+ height=64,
50
+ width=64,
51
+ num_inference_steps=2,
52
+ generator=torch.Generator(device=device).manual_seed(42),
53
+ output=['videos', 'audio', 'sampling_rate'],
54
+ )
55
+ print(type(outputs['videos'][0]), getattr(outputs['videos'][0], 'shape', None))
56
+ print(type(outputs['audio'][0]), getattr(outputs['audio'][0], 'shape', None), outputs['sampling_rate'])
57
+ ```
58
+
59
+ ### Codes to create this repo:
60
+
61
+ ```python
62
+ import json
63
+ from pathlib import Path
64
+
65
+ import torch
66
+ from diffusers import (
67
+ AutoencoderKLMiniMaxH3,
68
+ AutoencoderKLMiniMaxH3Audio,
69
+ MiniMaxH3Blocks,
70
+ MiniMaxH3Scheduler,
71
+ MiniMaxH3Transformer3DModel,
72
+ )
73
+ from huggingface_hub import hf_hub_download
74
+ from transformers import AutoConfig, AutoProcessor, AutoTokenizer, Qwen3VLForConditionalGeneration
75
+
76
+ source_model_id = "MiniMaxAI/MiniMax-H3"
77
+ save_folder = "/tmp/tiny-random/minimax-h3"
78
+
79
+ def save_json(path, obj):
80
+ Path(path).parent.mkdir(parents=True, exist_ok=True)
81
+ with open(path, 'w', encoding='utf-8') as f:
82
+ json.dump(obj, f, indent=2, ensure_ascii=False)
83
+
84
+ def init_weights(model):
85
+ torch.manual_seed(42)
86
+ model = model.cpu()
87
+ with torch.no_grad():
88
+ for name, p in sorted(model.named_parameters()):
89
+ torch.nn.init.normal_(p, 0, 0.1)
90
+ print(name, p.shape, p.dtype, p.device)
91
+
92
+ torch.set_default_dtype(torch.bfloat16)
93
+ text_dim = 32
94
+ Path(save_folder).mkdir(parents=True, exist_ok=True)
95
+
96
+ AutoTokenizer.from_pretrained(source_model_id, subfolder='tokenizer').save_pretrained(
97
+ f'{save_folder}/tokenizer'
98
+ )
99
+ AutoProcessor.from_pretrained(source_model_id, subfolder='processor').save_pretrained(
100
+ f'{save_folder}/processor'
101
+ )
102
+
103
+ with open(hf_hub_download(source_model_id, filename='text_encoder/config.json', repo_type='model'), 'r', encoding='utf-8') as f:
104
+ config = json.load(f)
105
+ # MiniMax-H3 conditions on hidden_states[50], so keep >50 layers with a tiny width.
106
+ config['text_config'].update({
107
+ 'head_dim': 8,
108
+ 'hidden_size': text_dim,
109
+ 'intermediate_size': 64,
110
+ 'num_attention_heads': 4,
111
+ 'num_key_value_heads': 2,
112
+ 'num_hidden_layers': 51,
113
+ 'tie_word_embeddings': True,
114
+ })
115
+ config['text_config']['rope_scaling']['mrope_section'] = [2, 1, 1]
116
+ config['vision_config'].update({
117
+ 'depth': 4,
118
+ 'hidden_size': 64,
119
+ 'intermediate_size': 128,
120
+ 'num_heads': 4,
121
+ 'out_hidden_size': text_dim,
122
+ 'deepstack_visual_indexes': [1, 2, 3],
123
+ })
124
+ config['tie_word_embeddings'] = True
125
+ save_json(f'{save_folder}/text_encoder/config.json', config)
126
+ text_encoder = Qwen3VLForConditionalGeneration(
127
+ AutoConfig.from_pretrained(f'{save_folder}/text_encoder')
128
+ ).to(torch.bfloat16)
129
+ init_weights(text_encoder)
130
+ text_encoder.save_pretrained(f'{save_folder}/text_encoder')
131
+
132
+ # attention_head_dim must cover 2 * 3 * rope_freq_dim rotary channels.
133
+ transformer_kwargs = dict(
134
+ num_attention_heads=2,
135
+ attention_head_dim=32,
136
+ hidden_size=64,
137
+ num_layers=2,
138
+ num_refiner_layers=1,
139
+ ffn_dim=128,
140
+ in_channels=8,
141
+ audio_in_channels=8,
142
+ patch_size=(1, 2, 2),
143
+ text_dim=text_dim,
144
+ freq_dim=64,
145
+ time_embed_hidden_dim=64,
146
+ time_embed_dim=32,
147
+ rope_freq_dim=4,
148
+ )
149
+ for subfolder in ('transformer', 'transformer_ref'):
150
+ transformer = MiniMaxH3Transformer3DModel(**transformer_kwargs)
151
+ init_weights(transformer)
152
+ transformer.save_pretrained(f'{save_folder}/{subfolder}')
153
+
154
+ with open(hf_hub_download(source_model_id, filename='vae/config.json', repo_type='model'), 'r', encoding='utf-8') as f:
155
+ vae_config = json.load(f)
156
+ vae_config.update({
157
+ 'latent_channels': 8,
158
+ 'block_out_channels': [32, 32, 32, 64, 64, 64],
159
+ 'layers_per_block': 1,
160
+ 'spatial_downsample_factors': [2, 2, 2, 2, 1, 1],
161
+ 'temporal_downsample_factors': [1, 2, 2, 1, 1, 1],
162
+ 'norm_num_groups': 8,
163
+ 'decoder_num_layers': 2,
164
+ 'decoder_num_attention_heads': 2,
165
+ 'decoder_attention_head_dim': 16,
166
+ 'decoder_num_register_tokens': 2,
167
+ 'decoder_ffn_mult': 2,
168
+ 'latents_mean': [0.0] * 8,
169
+ 'latents_std': [1.0] * 8,
170
+ })
171
+ save_json(f'{save_folder}/vae/config.json', vae_config)
172
+ vae = AutoencoderKLMiniMaxH3.from_config(
173
+ AutoencoderKLMiniMaxH3.load_config(f'{save_folder}/vae')
174
+ )
175
+ init_weights(vae)
176
+ vae.save_pretrained(f'{save_folder}/vae')
177
+
178
+ # Keep hop length 800 (=32000/40Hz). decoder_dim must stay >= 128 for 7 upsample stages.
179
+ with open(hf_hub_download(source_model_id, filename='audio_vae/config.json', repo_type='model'), 'r', encoding='utf-8') as f:
180
+ audio_config = json.load(f)
181
+ audio_config.update({
182
+ 'encoder_dim': 32,
183
+ 'latent_dim': 128,
184
+ 'latent_channels': 8,
185
+ 'num_attention_heads': 4,
186
+ 'decoder_dim': 128,
187
+ 'latents_mean': [0.0] * 8,
188
+ 'latents_std': [1.0] * 8,
189
+ })
190
+ save_json(f'{save_folder}/audio_vae/config.json', audio_config)
191
+ audio_vae = AutoencoderKLMiniMaxH3Audio.from_config(
192
+ AutoencoderKLMiniMaxH3Audio.load_config(f'{save_folder}/audio_vae')
193
+ )
194
+ init_weights(audio_vae)
195
+ audio_vae.save_pretrained(f'{save_folder}/audio_vae')
196
+
197
+ MiniMaxH3Scheduler.from_pretrained(source_model_id, subfolder='scheduler').save_pretrained(
198
+ f'{save_folder}/scheduler'
199
+ )
200
+ MiniMaxH3Scheduler.from_pretrained(source_model_id, subfolder='audio_scheduler').save_pretrained(
201
+ f'{save_folder}/audio_scheduler'
202
+ )
203
+
204
+ for index_name in ('model_index.json', 'modular_model_index.json'):
205
+ index = json.load(open(hf_hub_download(source_model_id, filename=index_name, repo_type='model'), encoding='utf-8'))
206
+ for value in index.values():
207
+ if isinstance(value, list) and len(value) >= 3 and isinstance(value[2], dict):
208
+ value[2]['pretrained_model_name_or_path'] = save_folder
209
+ save_json(f'{save_folder}/{index_name}', index)
210
+
211
+ pipe = MiniMaxH3Blocks().init_pipeline(save_folder)
212
+ pipe.load_components(dtype=torch.bfloat16)
213
+ pipe.save_pretrained(save_folder, safe_serialization=True, overwrite_modular_index=True)
214
+ torch.set_default_dtype(torch.float32)
215
+ print(pipe)
216
+ ```
217
+
218
+ ### Printing the model:
219
+
220
+ ```text
221
+ MiniMaxH3ModularPipeline {
222
+ "_blocks_class_name": "MiniMaxH3Blocks",
223
+ "_class_name": "MiniMaxH3ModularPipeline",
224
+ "_diffusers_version": "0.40.0.dev0",
225
+ "audio_scheduler": [
226
+ "diffusers",
227
+ "MiniMaxH3Scheduler",
228
+ {
229
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
230
+ "revision": null,
231
+ "subfolder": "audio_scheduler",
232
+ "type_hint": [
233
+ "diffusers",
234
+ "MiniMaxH3Scheduler"
235
+ ],
236
+ "variant": null
237
+ }
238
+ ],
239
+ "audio_vae": [
240
+ "diffusers",
241
+ "AutoencoderKLMiniMaxH3Audio",
242
+ {
243
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
244
+ "revision": null,
245
+ "subfolder": "audio_vae",
246
+ "type_hint": [
247
+ "diffusers",
248
+ "AutoencoderKLMiniMaxH3Audio"
249
+ ],
250
+ "variant": null
251
+ }
252
+ ],
253
+ "canvas_max_pixels": 1032192,
254
+ "canvas_short_edge": 768,
255
+ "processor": [
256
+ "transformers",
257
+ "Qwen3VLProcessor",
258
+ {
259
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
260
+ "revision": null,
261
+ "subfolder": "processor",
262
+ "type_hint": [
263
+ "transformers",
264
+ "Qwen3VLProcessor"
265
+ ],
266
+ "variant": null
267
+ }
268
+ ],
269
+ "reference_image_short_edge": 2048,
270
+ "scheduler": [
271
+ "diffusers",
272
+ "MiniMaxH3Scheduler",
273
+ {
274
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
275
+ "revision": null,
276
+ "subfolder": "scheduler",
277
+ "type_hint": [
278
+ "diffusers",
279
+ "MiniMaxH3Scheduler"
280
+ ],
281
+ "variant": null
282
+ }
283
+ ],
284
+ "text_encoder": [
285
+ "transformers",
286
+ "Qwen3VLForConditionalGeneration",
287
+ {
288
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
289
+ "revision": null,
290
+ "subfolder": "text_encoder",
291
+ "type_hint": [
292
+ "transformers",
293
+ "Qwen3VLForConditionalGeneration"
294
+ ],
295
+ "variant": null
296
+ }
297
+ ],
298
+ "tokenizer": [
299
+ "transformers",
300
+ "Qwen2Tokenizer",
301
+ {
302
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
303
+ "revision": null,
304
+ "subfolder": "tokenizer",
305
+ "type_hint": [
306
+ "transformers",
307
+ "Qwen2Tokenizer"
308
+ ],
309
+ "variant": null
310
+ }
311
+ ],
312
+ "transformer": [
313
+ "diffusers",
314
+ "MiniMaxH3Transformer3DModel",
315
+ {
316
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
317
+ "revision": null,
318
+ "subfolder": "transformer",
319
+ "type_hint": [
320
+ "diffusers",
321
+ "MiniMaxH3Transformer3DModel"
322
+ ],
323
+ "variant": null
324
+ }
325
+ ],
326
+ "transformer_ref": [
327
+ "diffusers",
328
+ "MiniMaxH3Transformer3DModel",
329
+ {
330
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
331
+ "revision": null,
332
+ "subfolder": "transformer_ref",
333
+ "type_hint": [
334
+ "diffusers",
335
+ "MiniMaxH3Transformer3DModel"
336
+ ],
337
+ "variant": null
338
+ }
339
+ ],
340
+ "vae": [
341
+ "diffusers",
342
+ "AutoencoderKLMiniMaxH3",
343
+ {
344
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
345
+ "revision": null,
346
+ "subfolder": "vae",
347
+ "type_hint": [
348
+ "diffusers",
349
+ "AutoencoderKLMiniMaxH3"
350
+ ],
351
+ "variant": null
352
+ }
353
+ ]
354
+ }
355
+ ```
audio_scheduler/scheduler_config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "MiniMaxH3Scheduler",
3
+ "_diffusers_version": "0.40.0.dev0",
4
+ "shift": 3.0
5
+ }
audio_vae/config.json ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "AutoencoderKLMiniMaxH3Audio",
3
+ "_diffusers_version": "0.40.0.dev0",
4
+ "_name_or_path": "./tmp/tiny-random/minimax-h3",
5
+ "decoder_dim": 128,
6
+ "decoder_kernel_sizes": [
7
+ 9,
8
+ 9,
9
+ 4,
10
+ 4,
11
+ 4,
12
+ 4,
13
+ 4
14
+ ],
15
+ "decoder_rates": [
16
+ 5,
17
+ 5,
18
+ 2,
19
+ 2,
20
+ 2,
21
+ 2,
22
+ 2
23
+ ],
24
+ "encoder_dim": 32,
25
+ "encoder_rates": [
26
+ 2,
27
+ 4,
28
+ 4,
29
+ 5,
30
+ 5
31
+ ],
32
+ "latent_channels": 8,
33
+ "latent_dim": 128,
34
+ "latents_mean": [
35
+ 0.0,
36
+ 0.0,
37
+ 0.0,
38
+ 0.0,
39
+ 0.0,
40
+ 0.0,
41
+ 0.0,
42
+ 0.0
43
+ ],
44
+ "latents_std": [
45
+ 1.0,
46
+ 1.0,
47
+ 1.0,
48
+ 1.0,
49
+ 1.0,
50
+ 1.0,
51
+ 1.0,
52
+ 1.0
53
+ ],
54
+ "num_attention_heads": 4,
55
+ "resblock_dilation_sizes": [
56
+ [
57
+ 1,
58
+ 3,
59
+ 5
60
+ ],
61
+ [
62
+ 1,
63
+ 3,
64
+ 5
65
+ ],
66
+ [
67
+ 1,
68
+ 3,
69
+ 5
70
+ ]
71
+ ],
72
+ "resblock_kernel_sizes": [
73
+ 3,
74
+ 7,
75
+ 11
76
+ ],
77
+ "sampling_rate": 32000
78
+ }
audio_vae/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a9928676863a1a8c2a9ec549e5cc85f7ad986587c5ec1b7597aaa5db2c59a3c
3
+ size 66721604
model_index.json ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "MiniMaxH3ModularPipeline",
3
+ "_diffusers_version": "0.36.0.dev0",
4
+ "_blocks_class_name": "MiniMaxH3Blocks",
5
+ "text_encoder": [
6
+ "transformers",
7
+ "Qwen3VLForConditionalGeneration",
8
+ {
9
+ "type_hint": [
10
+ "transformers",
11
+ "Qwen3VLForConditionalGeneration"
12
+ ],
13
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
14
+ "subfolder": "text_encoder",
15
+ "variant": null,
16
+ "revision": null
17
+ }
18
+ ],
19
+ "tokenizer": [
20
+ "transformers",
21
+ "Qwen2TokenizerFast",
22
+ {
23
+ "type_hint": [
24
+ "transformers",
25
+ "Qwen2TokenizerFast"
26
+ ],
27
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
28
+ "subfolder": "tokenizer",
29
+ "variant": null,
30
+ "revision": null
31
+ }
32
+ ],
33
+ "processor": [
34
+ "transformers",
35
+ "Qwen3VLProcessor",
36
+ {
37
+ "type_hint": [
38
+ "transformers",
39
+ "Qwen3VLProcessor"
40
+ ],
41
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
42
+ "subfolder": "processor",
43
+ "variant": null,
44
+ "revision": null
45
+ }
46
+ ],
47
+ "vae": [
48
+ "diffusers",
49
+ "AutoencoderKLMiniMaxH3",
50
+ {
51
+ "type_hint": [
52
+ "diffusers",
53
+ "AutoencoderKLMiniMaxH3"
54
+ ],
55
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
56
+ "subfolder": "vae",
57
+ "variant": null,
58
+ "revision": null
59
+ }
60
+ ],
61
+ "audio_vae": [
62
+ "diffusers",
63
+ "AutoencoderKLMiniMaxH3Audio",
64
+ {
65
+ "type_hint": [
66
+ "diffusers",
67
+ "AutoencoderKLMiniMaxH3Audio"
68
+ ],
69
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
70
+ "subfolder": "audio_vae",
71
+ "variant": null,
72
+ "revision": null
73
+ }
74
+ ],
75
+ "transformer": [
76
+ "diffusers",
77
+ "MiniMaxH3Transformer3DModel",
78
+ {
79
+ "type_hint": [
80
+ "diffusers",
81
+ "MiniMaxH3Transformer3DModel"
82
+ ],
83
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
84
+ "subfolder": "transformer",
85
+ "variant": null,
86
+ "revision": null
87
+ }
88
+ ],
89
+ "transformer_ref": [
90
+ "diffusers",
91
+ "MiniMaxH3Transformer3DModel",
92
+ {
93
+ "type_hint": [
94
+ "diffusers",
95
+ "MiniMaxH3Transformer3DModel"
96
+ ],
97
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
98
+ "subfolder": "transformer_ref",
99
+ "variant": null,
100
+ "revision": null
101
+ }
102
+ ],
103
+ "scheduler": [
104
+ "diffusers",
105
+ "MiniMaxH3Scheduler",
106
+ {
107
+ "type_hint": [
108
+ "diffusers",
109
+ "MiniMaxH3Scheduler"
110
+ ],
111
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
112
+ "subfolder": "scheduler",
113
+ "variant": null,
114
+ "revision": null
115
+ }
116
+ ],
117
+ "audio_scheduler": [
118
+ "diffusers",
119
+ "MiniMaxH3Scheduler",
120
+ {
121
+ "type_hint": [
122
+ "diffusers",
123
+ "MiniMaxH3Scheduler"
124
+ ],
125
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
126
+ "subfolder": "audio_scheduler",
127
+ "variant": null,
128
+ "revision": null
129
+ }
130
+ ]
131
+ }
modular_model_index.json ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_blocks_class_name": "MiniMaxH3Blocks",
3
+ "_class_name": "MiniMaxH3ModularPipeline",
4
+ "_diffusers_version": "0.40.0.dev0",
5
+ "audio_scheduler": [
6
+ "diffusers",
7
+ "MiniMaxH3Scheduler",
8
+ {
9
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
10
+ "revision": null,
11
+ "subfolder": "audio_scheduler",
12
+ "type_hint": [
13
+ "diffusers",
14
+ "MiniMaxH3Scheduler"
15
+ ],
16
+ "variant": null
17
+ }
18
+ ],
19
+ "audio_vae": [
20
+ "diffusers",
21
+ "AutoencoderKLMiniMaxH3Audio",
22
+ {
23
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
24
+ "revision": null,
25
+ "subfolder": "audio_vae",
26
+ "type_hint": [
27
+ "diffusers",
28
+ "AutoencoderKLMiniMaxH3Audio"
29
+ ],
30
+ "variant": null
31
+ }
32
+ ],
33
+ "canvas_max_pixels": 1032192,
34
+ "canvas_short_edge": 768,
35
+ "processor": [
36
+ "transformers",
37
+ "Qwen3VLProcessor",
38
+ {
39
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
40
+ "revision": null,
41
+ "subfolder": "processor",
42
+ "type_hint": [
43
+ "transformers",
44
+ "Qwen3VLProcessor"
45
+ ],
46
+ "variant": null
47
+ }
48
+ ],
49
+ "reference_image_short_edge": 2048,
50
+ "scheduler": [
51
+ "diffusers",
52
+ "MiniMaxH3Scheduler",
53
+ {
54
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
55
+ "revision": null,
56
+ "subfolder": "scheduler",
57
+ "type_hint": [
58
+ "diffusers",
59
+ "MiniMaxH3Scheduler"
60
+ ],
61
+ "variant": null
62
+ }
63
+ ],
64
+ "text_encoder": [
65
+ "transformers",
66
+ "Qwen3VLForConditionalGeneration",
67
+ {
68
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
69
+ "revision": null,
70
+ "subfolder": "text_encoder",
71
+ "type_hint": [
72
+ "transformers",
73
+ "Qwen3VLForConditionalGeneration"
74
+ ],
75
+ "variant": null
76
+ }
77
+ ],
78
+ "tokenizer": [
79
+ "transformers",
80
+ "Qwen2Tokenizer",
81
+ {
82
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
83
+ "revision": null,
84
+ "subfolder": "tokenizer",
85
+ "type_hint": [
86
+ "transformers",
87
+ "Qwen2Tokenizer"
88
+ ],
89
+ "variant": null
90
+ }
91
+ ],
92
+ "transformer": [
93
+ "diffusers",
94
+ "MiniMaxH3Transformer3DModel",
95
+ {
96
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
97
+ "revision": null,
98
+ "subfolder": "transformer",
99
+ "type_hint": [
100
+ "diffusers",
101
+ "MiniMaxH3Transformer3DModel"
102
+ ],
103
+ "variant": null
104
+ }
105
+ ],
106
+ "transformer_ref": [
107
+ "diffusers",
108
+ "MiniMaxH3Transformer3DModel",
109
+ {
110
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
111
+ "revision": null,
112
+ "subfolder": "transformer_ref",
113
+ "type_hint": [
114
+ "diffusers",
115
+ "MiniMaxH3Transformer3DModel"
116
+ ],
117
+ "variant": null
118
+ }
119
+ ],
120
+ "vae": [
121
+ "diffusers",
122
+ "AutoencoderKLMiniMaxH3",
123
+ {
124
+ "pretrained_model_name_or_path": "./tmp/tiny-random/minimax-h3",
125
+ "revision": null,
126
+ "subfolder": "vae",
127
+ "type_hint": [
128
+ "diffusers",
129
+ "AutoencoderKLMiniMaxH3"
130
+ ],
131
+ "variant": null
132
+ }
133
+ ]
134
+ }
processor/chat_template.jinja ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {%- if messages[0].content is string %}
5
+ {{- messages[0].content }}
6
+ {%- else %}
7
+ {%- for content in messages[0].content %}
8
+ {%- if 'text' in content %}
9
+ {{- content.text }}
10
+ {%- endif %}
11
+ {%- endfor %}
12
+ {%- endif %}
13
+ {{- '\n\n' }}
14
+ {%- endif %}
15
+ {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
16
+ {%- for tool in tools %}
17
+ {{- "\n" }}
18
+ {{- tool | tojson }}
19
+ {%- endfor %}
20
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
21
+ {%- else %}
22
+ {%- if messages[0].role == 'system' %}
23
+ {{- '<|im_start|>system\n' }}
24
+ {%- if messages[0].content is string %}
25
+ {{- messages[0].content }}
26
+ {%- else %}
27
+ {%- for content in messages[0].content %}
28
+ {%- if 'text' in content %}
29
+ {{- content.text }}
30
+ {%- endif %}
31
+ {%- endfor %}
32
+ {%- endif %}
33
+ {{- '<|im_end|>\n' }}
34
+ {%- endif %}
35
+ {%- endif %}
36
+ {%- set image_count = namespace(value=0) %}
37
+ {%- set video_count = namespace(value=0) %}
38
+ {%- for message in messages %}
39
+ {%- if message.role == "user" %}
40
+ {{- '<|im_start|>' + message.role + '\n' }}
41
+ {%- if message.content is string %}
42
+ {{- message.content }}
43
+ {%- else %}
44
+ {%- for content in message.content %}
45
+ {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}
46
+ {%- set image_count.value = image_count.value + 1 %}
47
+ {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}
48
+ <|vision_start|><|image_pad|><|vision_end|>
49
+ {%- elif content.type == 'video' or 'video' in content %}
50
+ {%- set video_count.value = video_count.value + 1 %}
51
+ {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}
52
+ <|vision_start|><|video_pad|><|vision_end|>
53
+ {%- elif 'text' in content %}
54
+ {{- content.text }}
55
+ {%- endif %}
56
+ {%- endfor %}
57
+ {%- endif %}
58
+ {{- '<|im_end|>\n' }}
59
+ {%- elif message.role == "assistant" %}
60
+ {{- '<|im_start|>' + message.role + '\n' }}
61
+ {%- if message.content is string %}
62
+ {{- message.content }}
63
+ {%- else %}
64
+ {%- for content_item in message.content %}
65
+ {%- if 'text' in content_item %}
66
+ {{- content_item.text }}
67
+ {%- endif %}
68
+ {%- endfor %}
69
+ {%- endif %}
70
+ {%- if message.tool_calls %}
71
+ {%- for tool_call in message.tool_calls %}
72
+ {%- if (loop.first and message.content) or (not loop.first) %}
73
+ {{- '\n' }}
74
+ {%- endif %}
75
+ {%- if tool_call.function %}
76
+ {%- set tool_call = tool_call.function %}
77
+ {%- endif %}
78
+ {{- '<tool_call>\n{"name": "' }}
79
+ {{- tool_call.name }}
80
+ {{- '", "arguments": ' }}
81
+ {%- if tool_call.arguments is string %}
82
+ {{- tool_call.arguments }}
83
+ {%- else %}
84
+ {{- tool_call.arguments | tojson }}
85
+ {%- endif %}
86
+ {{- '}\n</tool_call>' }}
87
+ {%- endfor %}
88
+ {%- endif %}
89
+ {{- '<|im_end|>\n' }}
90
+ {%- elif message.role == "tool" %}
91
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
92
+ {{- '<|im_start|>user' }}
93
+ {%- endif %}
94
+ {{- '\n<tool_response>\n' }}
95
+ {%- if message.content is string %}
96
+ {{- message.content }}
97
+ {%- else %}
98
+ {%- for content in message.content %}
99
+ {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}
100
+ {%- set image_count.value = image_count.value + 1 %}
101
+ {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}
102
+ <|vision_start|><|image_pad|><|vision_end|>
103
+ {%- elif content.type == 'video' or 'video' in content %}
104
+ {%- set video_count.value = video_count.value + 1 %}
105
+ {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}
106
+ <|vision_start|><|video_pad|><|vision_end|>
107
+ {%- elif 'text' in content %}
108
+ {{- content.text }}
109
+ {%- endif %}
110
+ {%- endfor %}
111
+ {%- endif %}
112
+ {{- '\n</tool_response>' }}
113
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
114
+ {{- '<|im_end|>\n' }}
115
+ {%- endif %}
116
+ {%- endif %}
117
+ {%- endfor %}
118
+ {%- if add_generation_prompt %}
119
+ {{- '<|im_start|>assistant\n' }}
120
+ {%- endif %}
processor/processor_config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "do_convert_rgb": true,
4
+ "do_normalize": true,
5
+ "do_rescale": true,
6
+ "do_resize": true,
7
+ "image_mean": [
8
+ 0.5,
9
+ 0.5,
10
+ 0.5
11
+ ],
12
+ "image_processor_type": "Qwen2VLImageProcessor",
13
+ "image_std": [
14
+ 0.5,
15
+ 0.5,
16
+ 0.5
17
+ ],
18
+ "merge_size": 2,
19
+ "patch_size": 16,
20
+ "resample": 3,
21
+ "rescale_factor": 0.00392156862745098,
22
+ "size": {
23
+ "longest_edge": 16777216,
24
+ "shortest_edge": 65536
25
+ },
26
+ "temporal_patch_size": 2
27
+ },
28
+ "processor_class": "Qwen3VLProcessor",
29
+ "video_processor": {
30
+ "do_convert_rgb": true,
31
+ "do_normalize": true,
32
+ "do_rescale": true,
33
+ "do_resize": true,
34
+ "do_sample_frames": true,
35
+ "fps": 2,
36
+ "image_mean": [
37
+ 0.5,
38
+ 0.5,
39
+ 0.5
40
+ ],
41
+ "image_std": [
42
+ 0.5,
43
+ 0.5,
44
+ 0.5
45
+ ],
46
+ "max_frames": 768,
47
+ "merge_size": 2,
48
+ "min_frames": 4,
49
+ "patch_size": 16,
50
+ "resample": 3,
51
+ "rescale_factor": 0.00392156862745098,
52
+ "return_metadata": false,
53
+ "size": {
54
+ "longest_edge": 25165824,
55
+ "shortest_edge": 4096
56
+ },
57
+ "temporal_patch_size": 2,
58
+ "video_processor_type": "Qwen3VLVideoProcessor"
59
+ }
60
+ }
processor/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:170c542379436ef9d4574ad325af3bf4c8c3ef295951fdc060a319a905bb7ff2
3
+ size 11423968
processor/tokenizer_config.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>",
11
+ "<|object_ref_start|>",
12
+ "<|object_ref_end|>",
13
+ "<|box_start|>",
14
+ "<|box_end|>",
15
+ "<|quad_start|>",
16
+ "<|quad_end|>",
17
+ "<|vision_start|>",
18
+ "<|vision_end|>",
19
+ "<|vision_pad|>",
20
+ "<|image_pad|>",
21
+ "<|video_pad|>",
22
+ "<d>",
23
+ "</d>",
24
+ "<|cutoff|>",
25
+ "<|lyrics_start|>",
26
+ "<|lyrics_end|>",
27
+ "<|caption_start|>",
28
+ "<|caption_end|>"
29
+ ],
30
+ "is_local": true,
31
+ "local_files_only": false,
32
+ "model_max_length": 262144,
33
+ "pad_token": "<|endoftext|>",
34
+ "processor_class": "Qwen3VLProcessor",
35
+ "split_special_tokens": false,
36
+ "tokenizer_class": "Qwen2Tokenizer",
37
+ "unk_token": null,
38
+ "variant": null
39
+ }
scheduler/scheduler_config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "MiniMaxH3Scheduler",
3
+ "_diffusers_version": "0.40.0.dev0",
4
+ "shift": 12.0
5
+ }
text_encoder/config.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3VLForConditionalGeneration"
4
+ ],
5
+ "dtype": "bfloat16",
6
+ "image_token_id": 151655,
7
+ "model_type": "qwen3_vl",
8
+ "text_config": {
9
+ "attention_bias": false,
10
+ "attention_dropout": 0.0,
11
+ "bos_token_id": 151643,
12
+ "dtype": "bfloat16",
13
+ "eos_token_id": 151645,
14
+ "head_dim": 8,
15
+ "hidden_act": "silu",
16
+ "hidden_size": 32,
17
+ "initializer_range": 0.02,
18
+ "intermediate_size": 64,
19
+ "max_position_embeddings": 262144,
20
+ "model_type": "qwen3_vl_text",
21
+ "num_attention_heads": 4,
22
+ "num_hidden_layers": 51,
23
+ "num_key_value_heads": 2,
24
+ "pad_token_id": null,
25
+ "rms_norm_eps": 1e-06,
26
+ "rope_parameters": {
27
+ "mrope_interleaved": true,
28
+ "mrope_section": [
29
+ 2,
30
+ 1,
31
+ 1
32
+ ],
33
+ "rope_theta": 5000000,
34
+ "rope_type": "default"
35
+ },
36
+ "tie_word_embeddings": true,
37
+ "use_cache": true,
38
+ "vocab_size": 151936
39
+ },
40
+ "tie_word_embeddings": true,
41
+ "transformers_version": "5.15.0.dev0",
42
+ "video_token_id": 151656,
43
+ "vision_config": {
44
+ "deepstack_visual_indexes": [
45
+ 1,
46
+ 2,
47
+ 3
48
+ ],
49
+ "depth": 4,
50
+ "dtype": "bfloat16",
51
+ "hidden_act": "gelu_pytorch_tanh",
52
+ "hidden_size": 64,
53
+ "in_channels": 3,
54
+ "initializer_range": 0.02,
55
+ "intermediate_size": 128,
56
+ "model_type": "qwen3_vl_vision",
57
+ "num_heads": 4,
58
+ "num_position_embeddings": 2304,
59
+ "out_hidden_size": 32,
60
+ "patch_size": 16,
61
+ "spatial_merge_size": 2,
62
+ "temporal_patch_size": 2
63
+ },
64
+ "vision_end_token_id": 151653,
65
+ "vision_start_token_id": 151652
66
+ }
text_encoder/generation_config.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 151643,
4
+ "eos_token_id": 151645,
5
+ "output_attentions": false,
6
+ "output_hidden_states": false,
7
+ "transformers_version": "5.15.0.dev0",
8
+ "use_cache": true
9
+ }
text_encoder/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:975ada26892c830c648bbe1322371a5aa646ad93d923720fbdef0d6023b0966e
3
+ size 12104296
tokenizer/chat_template.jinja ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if tools %}
2
+ {{- '<|im_start|>system\n' }}
3
+ {%- if messages[0].role == 'system' %}
4
+ {%- if messages[0].content is string %}
5
+ {{- messages[0].content }}
6
+ {%- else %}
7
+ {%- for content in messages[0].content %}
8
+ {%- if 'text' in content %}
9
+ {{- content.text }}
10
+ {%- endif %}
11
+ {%- endfor %}
12
+ {%- endif %}
13
+ {{- '\n\n' }}
14
+ {%- endif %}
15
+ {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
16
+ {%- for tool in tools %}
17
+ {{- "\n" }}
18
+ {{- tool | tojson }}
19
+ {%- endfor %}
20
+ {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
21
+ {%- else %}
22
+ {%- if messages[0].role == 'system' %}
23
+ {{- '<|im_start|>system\n' }}
24
+ {%- if messages[0].content is string %}
25
+ {{- messages[0].content }}
26
+ {%- else %}
27
+ {%- for content in messages[0].content %}
28
+ {%- if 'text' in content %}
29
+ {{- content.text }}
30
+ {%- endif %}
31
+ {%- endfor %}
32
+ {%- endif %}
33
+ {{- '<|im_end|>\n' }}
34
+ {%- endif %}
35
+ {%- endif %}
36
+ {%- set image_count = namespace(value=0) %}
37
+ {%- set video_count = namespace(value=0) %}
38
+ {%- for message in messages %}
39
+ {%- if message.role == "user" %}
40
+ {{- '<|im_start|>' + message.role + '\n' }}
41
+ {%- if message.content is string %}
42
+ {{- message.content }}
43
+ {%- else %}
44
+ {%- for content in message.content %}
45
+ {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}
46
+ {%- set image_count.value = image_count.value + 1 %}
47
+ {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}
48
+ <|vision_start|><|image_pad|><|vision_end|>
49
+ {%- elif content.type == 'video' or 'video' in content %}
50
+ {%- set video_count.value = video_count.value + 1 %}
51
+ {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}
52
+ <|vision_start|><|video_pad|><|vision_end|>
53
+ {%- elif 'text' in content %}
54
+ {{- content.text }}
55
+ {%- endif %}
56
+ {%- endfor %}
57
+ {%- endif %}
58
+ {{- '<|im_end|>\n' }}
59
+ {%- elif message.role == "assistant" %}
60
+ {{- '<|im_start|>' + message.role + '\n' }}
61
+ {%- if message.content is string %}
62
+ {{- message.content }}
63
+ {%- else %}
64
+ {%- for content_item in message.content %}
65
+ {%- if 'text' in content_item %}
66
+ {{- content_item.text }}
67
+ {%- endif %}
68
+ {%- endfor %}
69
+ {%- endif %}
70
+ {%- if message.tool_calls %}
71
+ {%- for tool_call in message.tool_calls %}
72
+ {%- if (loop.first and message.content) or (not loop.first) %}
73
+ {{- '\n' }}
74
+ {%- endif %}
75
+ {%- if tool_call.function %}
76
+ {%- set tool_call = tool_call.function %}
77
+ {%- endif %}
78
+ {{- '<tool_call>\n{"name": "' }}
79
+ {{- tool_call.name }}
80
+ {{- '", "arguments": ' }}
81
+ {%- if tool_call.arguments is string %}
82
+ {{- tool_call.arguments }}
83
+ {%- else %}
84
+ {{- tool_call.arguments | tojson }}
85
+ {%- endif %}
86
+ {{- '}\n</tool_call>' }}
87
+ {%- endfor %}
88
+ {%- endif %}
89
+ {{- '<|im_end|>\n' }}
90
+ {%- elif message.role == "tool" %}
91
+ {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
92
+ {{- '<|im_start|>user' }}
93
+ {%- endif %}
94
+ {{- '\n<tool_response>\n' }}
95
+ {%- if message.content is string %}
96
+ {{- message.content }}
97
+ {%- else %}
98
+ {%- for content in message.content %}
99
+ {%- if content.type == 'image' or 'image' in content or 'image_url' in content %}
100
+ {%- set image_count.value = image_count.value + 1 %}
101
+ {%- if add_vision_id %}Picture {{ image_count.value }}: {% endif -%}
102
+ <|vision_start|><|image_pad|><|vision_end|>
103
+ {%- elif content.type == 'video' or 'video' in content %}
104
+ {%- set video_count.value = video_count.value + 1 %}
105
+ {%- if add_vision_id %}Video {{ video_count.value }}: {% endif -%}
106
+ <|vision_start|><|video_pad|><|vision_end|>
107
+ {%- elif 'text' in content %}
108
+ {{- content.text }}
109
+ {%- endif %}
110
+ {%- endfor %}
111
+ {%- endif %}
112
+ {{- '\n</tool_response>' }}
113
+ {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
114
+ {{- '<|im_end|>\n' }}
115
+ {%- endif %}
116
+ {%- endif %}
117
+ {%- endfor %}
118
+ {%- if add_generation_prompt %}
119
+ {{- '<|im_start|>assistant\n' }}
120
+ {%- endif %}
tokenizer/tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:170c542379436ef9d4574ad325af3bf4c8c3ef295951fdc060a319a905bb7ff2
3
+ size 11423968
tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": null,
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>",
11
+ "<|object_ref_start|>",
12
+ "<|object_ref_end|>",
13
+ "<|box_start|>",
14
+ "<|box_end|>",
15
+ "<|quad_start|>",
16
+ "<|quad_end|>",
17
+ "<|vision_start|>",
18
+ "<|vision_end|>",
19
+ "<|vision_pad|>",
20
+ "<|image_pad|>",
21
+ "<|video_pad|>",
22
+ "<d>",
23
+ "</d>",
24
+ "<|cutoff|>",
25
+ "<|lyrics_start|>",
26
+ "<|lyrics_end|>",
27
+ "<|caption_start|>",
28
+ "<|caption_end|>"
29
+ ],
30
+ "is_local": true,
31
+ "local_files_only": false,
32
+ "model_max_length": 262144,
33
+ "pad_token": "<|endoftext|>",
34
+ "split_special_tokens": false,
35
+ "tokenizer_class": "Qwen2Tokenizer",
36
+ "unk_token": null,
37
+ "variant": null
38
+ }
transformer/config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "MiniMaxH3Transformer3DModel",
3
+ "_diffusers_version": "0.40.0.dev0",
4
+ "_name_or_path": "./tmp/tiny-random/minimax-h3",
5
+ "attention_head_dim": 32,
6
+ "audio_in_channels": 8,
7
+ "ffn_dim": 128,
8
+ "final_norm_eps": 1e-05,
9
+ "freq_dim": 64,
10
+ "hidden_size": 64,
11
+ "in_channels": 8,
12
+ "norm_eps": 1e-05,
13
+ "num_attention_heads": 2,
14
+ "num_layers": 2,
15
+ "num_refiner_layers": 1,
16
+ "patch_size": [
17
+ 1,
18
+ 2,
19
+ 2
20
+ ],
21
+ "qk_norm_eps": 1e-05,
22
+ "rope_freq_dim": 4,
23
+ "rope_theta": 10000.0,
24
+ "text_dim": 32,
25
+ "time_embed_dim": 32,
26
+ "time_embed_hidden_dim": 64
27
+ }
transformer/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a17afecb6ae5e65d91c46a61ed19fd69e4717cbe6d125f6c6046fbf65d76f6fb
3
+ size 463184
transformer_ref/config.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "MiniMaxH3Transformer3DModel",
3
+ "_diffusers_version": "0.40.0.dev0",
4
+ "_name_or_path": "./tmp/tiny-random/minimax-h3",
5
+ "attention_head_dim": 32,
6
+ "audio_in_channels": 8,
7
+ "ffn_dim": 128,
8
+ "final_norm_eps": 1e-05,
9
+ "freq_dim": 64,
10
+ "hidden_size": 64,
11
+ "in_channels": 8,
12
+ "norm_eps": 1e-05,
13
+ "num_attention_heads": 2,
14
+ "num_layers": 2,
15
+ "num_refiner_layers": 1,
16
+ "patch_size": [
17
+ 1,
18
+ 2,
19
+ 2
20
+ ],
21
+ "qk_norm_eps": 1e-05,
22
+ "rope_freq_dim": 4,
23
+ "rope_theta": 10000.0,
24
+ "text_dim": 32,
25
+ "time_embed_dim": 32,
26
+ "time_embed_hidden_dim": 64
27
+ }
transformer_ref/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a17afecb6ae5e65d91c46a61ed19fd69e4717cbe6d125f6c6046fbf65d76f6fb
3
+ size 463184
vae/config.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "AutoencoderKLMiniMaxH3",
3
+ "_diffusers_version": "0.40.0.dev0",
4
+ "_name_or_path": "./tmp/tiny-random/minimax-h3",
5
+ "block_out_channels": [
6
+ 32,
7
+ 32,
8
+ 32,
9
+ 64,
10
+ 64,
11
+ 64
12
+ ],
13
+ "clip_length": 17,
14
+ "decoder_attention_head_dim": 16,
15
+ "decoder_ffn_mult": 2,
16
+ "decoder_norm_eps": 1e-05,
17
+ "decoder_num_attention_heads": 2,
18
+ "decoder_num_layers": 2,
19
+ "decoder_num_register_tokens": 2,
20
+ "decoder_rope_dim_ratio": 0.75,
21
+ "decoder_rope_theta": 100.0,
22
+ "in_channels": 3,
23
+ "latent_channels": 8,
24
+ "latents_mean": [
25
+ 0.0,
26
+ 0.0,
27
+ 0.0,
28
+ 0.0,
29
+ 0.0,
30
+ 0.0,
31
+ 0.0,
32
+ 0.0
33
+ ],
34
+ "latents_std": [
35
+ 1.0,
36
+ 1.0,
37
+ 1.0,
38
+ 1.0,
39
+ 1.0,
40
+ 1.0,
41
+ 1.0,
42
+ 1.0
43
+ ],
44
+ "layers_per_block": 1,
45
+ "norm_eps": 1e-06,
46
+ "norm_num_groups": 8,
47
+ "out_channels": 3,
48
+ "spatial_downsample_factors": [
49
+ 2,
50
+ 2,
51
+ 2,
52
+ 2,
53
+ 1,
54
+ 1
55
+ ],
56
+ "spatial_padding_mode": "reflect",
57
+ "temporal_downsample_factors": [
58
+ 1,
59
+ 2,
60
+ 2,
61
+ 1,
62
+ 1,
63
+ 1
64
+ ],
65
+ "token_drop": 3
66
+ }
vae/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1d7653f9103b32fe03919fbcca9482fb2cf0ee95dc8423c668baf11a67bb068c
3
+ size 4513304