[Tests] Config driven tiny model builder (#5090)
Signed-off-by: Nick Cao <ncao@redhat.com>
This commit is contained in:
1 parent
cc1939120f
commit
f10320f53f
18 files changed
+601
-60
No files matched your search
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"_class_name": "Flux2KleinPipeline",
|
||||
"_diffusers_version": "0.37.0.dev0",
|
||||
"is_distilled": true,
|
||||
"scheduler": [
|
||||
"diffusers",
|
||||
"FlowMatchEulerDiscreteScheduler"
|
||||
],
|
||||
"text_encoder": [
|
||||
"transformers",
|
||||
"Qwen3ForCausalLM"
|
||||
],
|
||||
"tokenizer": [
|
||||
"transformers",
|
||||
"Qwen2TokenizerFast"
|
||||
],
|
||||
"transformer": [
|
||||
"diffusers",
|
||||
"Flux2Transformer2DModel"
|
||||
],
|
||||
"vae": [
|
||||
"diffusers",
|
||||
"AutoencoderKLFlux2"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"architectures": [
|
||||
"Qwen3ForCausalLM"
|
||||
],
|
||||
"attention_bias": false,
|
||||
"attention_dropout": 0.0,
|
||||
"bos_token_id": 151643,
|
||||
"dtype": "bfloat16",
|
||||
"eos_token_id": 151645,
|
||||
"head_dim": 16,
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 32,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 64,
|
||||
"layer_types": [
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention",
|
||||
"full_attention"
|
||||
],
|
||||
"max_position_embeddings": 512,
|
||||
"max_window_layers": 36,
|
||||
"model_type": "qwen3",
|
||||
"num_attention_heads": 2,
|
||||
"num_hidden_layers": 28,
|
||||
"num_key_value_heads": 2,
|
||||
"rms_norm_eps": 1e-06,
|
||||
"rope_scaling": null,
|
||||
"rope_theta": 1000000,
|
||||
"sliding_window": null,
|
||||
"tie_word_embeddings": true,
|
||||
"transformers_version": "4.56.1",
|
||||
"use_cache": true,
|
||||
"use_sliding_window": false,
|
||||
"vocab_size": 151936
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"_class_name": "Flux2Transformer2DModel",
|
||||
"_diffusers_version": "0.37.0.dev0",
|
||||
"_name_or_path": "/raid/yiyi/klein-4b-distilled-diffusers/transformer",
|
||||
"attention_head_dim": 16,
|
||||
"axes_dims_rope": [
|
||||
4,
|
||||
4,
|
||||
4,
|
||||
4
|
||||
],
|
||||
"eps": 1e-06,
|
||||
"guidance_embeds": false,
|
||||
"in_channels": 64,
|
||||
"joint_attention_dim": 96,
|
||||
"mlp_ratio": 3.0,
|
||||
"num_attention_heads": 2,
|
||||
"num_layers": 2,
|
||||
"num_single_layers": 2,
|
||||
"out_channels": null,
|
||||
"patch_size": 1,
|
||||
"rope_theta": 2000,
|
||||
"timestep_guidance_channels": 32
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"_class_name": "AutoencoderKLFlux2",
|
||||
"_diffusers_version": "0.37.0.dev0",
|
||||
"_name_or_path": "black-forest-labs/FLUX.2-dev",
|
||||
"act_fn": "silu",
|
||||
"batch_norm_eps": 0.0001,
|
||||
"batch_norm_momentum": 0.1,
|
||||
"block_out_channels": [
|
||||
32
|
||||
],
|
||||
"down_block_types": [
|
||||
"DownEncoderBlock2D"
|
||||
],
|
||||
"force_upcast": true,
|
||||
"in_channels": 3,
|
||||
"latent_channels": 16,
|
||||
"layers_per_block": 1,
|
||||
"mid_block_add_attention": true,
|
||||
"norm_num_groups": 16,
|
||||
"out_channels": 3,
|
||||
"patch_size": [
|
||||
2,
|
||||
2
|
||||
],
|
||||
"sample_size": 1024,
|
||||
"up_block_types": [
|
||||
"UpDecoderBlock2D"
|
||||
],
|
||||
"use_post_quant_conv": true,
|
||||
"use_quant_conv": true
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"_class_name": "AutoencoderKLLTX2Audio",
|
||||
"_diffusers_version": "0.37.0.dev0",
|
||||
"attn_resolutions": null,
|
||||
"base_channels": 128,
|
||||
"causality_axis": "height",
|
||||
"ch_mult": [
|
||||
1,
|
||||
2,
|
||||
4
|
||||
],
|
||||
"double_z": true,
|
||||
"dropout": 0.0,
|
||||
"in_channels": 2,
|
||||
"is_causal": true,
|
||||
"latent_channels": 8,
|
||||
"mel_bins": 64,
|
||||
"mel_hop_length": 160,
|
||||
"mid_block_add_attention": false,
|
||||
"norm_type": "pixel",
|
||||
"num_res_blocks": 1,
|
||||
"output_channels": 2,
|
||||
"resolution": 256,
|
||||
"sample_rate": 16000
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"_class_name": "LTX2TextConnectors",
|
||||
"_diffusers_version": "0.37.0.dev0",
|
||||
"audio_connector_attention_head_dim": 16,
|
||||
"audio_connector_num_attention_heads": 2,
|
||||
"audio_connector_num_layers": 1,
|
||||
"audio_connector_num_learnable_registers": 4,
|
||||
"caption_channels": 32,
|
||||
"causal_temporal_positioning": false,
|
||||
"connector_rope_base_seq_len": 32,
|
||||
"rope_double_precision": true,
|
||||
"rope_theta": 10000.0,
|
||||
"rope_type": "split",
|
||||
"text_proj_in_factor": 3,
|
||||
"video_connector_attention_head_dim": 16,
|
||||
"video_connector_num_attention_heads": 2,
|
||||
"video_connector_num_layers": 1,
|
||||
"video_connector_num_learnable_registers": 4,
|
||||
"video_hidden_dim": 32,
|
||||
"audio_hidden_dim": 32
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"_class_name": "LTX2Pipeline",
|
||||
"_diffusers_version": "0.37.0.dev0",
|
||||
"audio_vae": [
|
||||
"diffusers",
|
||||
"AutoencoderKLLTX2Audio"
|
||||
],
|
||||
"connectors": [
|
||||
"ltx2",
|
||||
"LTX2TextConnectors"
|
||||
],
|
||||
"scheduler": [
|
||||
"diffusers",
|
||||
"FlowMatchEulerDiscreteScheduler"
|
||||
],
|
||||
"text_encoder": [
|
||||
"transformers",
|
||||
"Gemma3ForConditionalGeneration"
|
||||
],
|
||||
"tokenizer": [
|
||||
"transformers",
|
||||
"GemmaTokenizerFast"
|
||||
],
|
||||
"transformer": [
|
||||
"diffusers",
|
||||
"LTX2VideoTransformer3DModel"
|
||||
],
|
||||
"vae": [
|
||||
"diffusers",
|
||||
"AutoencoderKLLTX2Video"
|
||||
],
|
||||
"vocoder": [
|
||||
"ltx2",
|
||||
"LTX2Vocoder"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"architectures": [
|
||||
"Gemma3ForConditionalGeneration"
|
||||
],
|
||||
"boi_token_index": 255999,
|
||||
"dtype": "float32",
|
||||
"eoi_token_index": 256000,
|
||||
"eos_token_id": [
|
||||
1,
|
||||
106
|
||||
],
|
||||
"image_token_index": 262144,
|
||||
"initializer_range": 0.02,
|
||||
"mm_tokens_per_image": 256,
|
||||
"model_type": "gemma3",
|
||||
"text_config": {
|
||||
"_sliding_window_pattern": 6,
|
||||
"attention_bias": false,
|
||||
"attention_dropout": 0.0,
|
||||
"attn_logit_softcapping": null,
|
||||
"cache_implementation": "hybrid",
|
||||
"dtype": "float32",
|
||||
"final_logit_softcapping": null,
|
||||
"head_dim": 16,
|
||||
"hidden_activation": "gelu_pytorch_tanh",
|
||||
"hidden_size": 32,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 64,
|
||||
"layer_types": [
|
||||
"sliding_attention",
|
||||
"full_attention"
|
||||
],
|
||||
"max_position_embeddings": 512,
|
||||
"model_type": "gemma3_text",
|
||||
"num_attention_heads": 2,
|
||||
"num_hidden_layers": 2,
|
||||
"num_key_value_heads": 2,
|
||||
"query_pre_attn_scalar": 16,
|
||||
"rms_norm_eps": 1e-06,
|
||||
"rope_local_base_freq": 10000,
|
||||
"rope_scaling": {
|
||||
"factor": 8.0,
|
||||
"rope_type": "linear"
|
||||
},
|
||||
"rope_theta": 1000000,
|
||||
"sliding_window": 1024,
|
||||
"sliding_window_pattern": 6,
|
||||
"use_bidirectional_attention": false,
|
||||
"use_cache": true,
|
||||
"vocab_size": 262208
|
||||
},
|
||||
"transformers_version": "4.57.3",
|
||||
"vision_config": {
|
||||
"attention_dropout": 0.0,
|
||||
"dtype": "float32",
|
||||
"hidden_act": "gelu_pytorch_tanh",
|
||||
"hidden_size": 32,
|
||||
"image_size": 896,
|
||||
"intermediate_size": 64,
|
||||
"layer_norm_eps": 1e-06,
|
||||
"model_type": "siglip_vision_model",
|
||||
"num_attention_heads": 2,
|
||||
"num_channels": 3,
|
||||
"num_hidden_layers": 2,
|
||||
"patch_size": 14,
|
||||
"vision_use_head": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"_class_name": "LTX2VideoTransformer3DModel",
|
||||
"_diffusers_version": "0.37.0.dev0",
|
||||
"activation_fn": "gelu-approximate",
|
||||
"attention_bias": true,
|
||||
"attention_head_dim": 16,
|
||||
"attention_out_bias": true,
|
||||
"audio_attention_head_dim": 16,
|
||||
"audio_cross_attention_dim": 32,
|
||||
"audio_hop_length": 160,
|
||||
"audio_in_channels": 128,
|
||||
"audio_num_attention_heads": 2,
|
||||
"audio_out_channels": 128,
|
||||
"audio_patch_size": 1,
|
||||
"audio_patch_size_t": 1,
|
||||
"audio_pos_embed_max_pos": 20,
|
||||
"audio_sampling_rate": 16000,
|
||||
"audio_scale_factor": 4,
|
||||
"base_height": 2048,
|
||||
"base_width": 2048,
|
||||
"caption_channels": 32,
|
||||
"causal_offset": 1,
|
||||
"cross_attention_dim": 32,
|
||||
"cross_attn_timestep_scale_multiplier": 1000,
|
||||
"in_channels": 128,
|
||||
"norm_elementwise_affine": false,
|
||||
"norm_eps": 1e-06,
|
||||
"num_attention_heads": 2,
|
||||
"num_layers": 2,
|
||||
"out_channels": 128,
|
||||
"patch_size": 1,
|
||||
"patch_size_t": 1,
|
||||
"pos_embed_max_pos": 20,
|
||||
"qk_norm": "rms_norm_across_heads",
|
||||
"rope_double_precision": true,
|
||||
"rope_theta": 10000.0,
|
||||
"rope_type": "split",
|
||||
"timestep_scale_multiplier": 1000,
|
||||
"vae_scale_factors": [
|
||||
8,
|
||||
32,
|
||||
32
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"_class_name": "AutoencoderKLLTX2Video",
|
||||
"_diffusers_version": "0.37.0.dev0",
|
||||
"block_out_channels": [
|
||||
256,
|
||||
512,
|
||||
1024,
|
||||
2048
|
||||
],
|
||||
"decoder_block_out_channels": [
|
||||
256,
|
||||
512,
|
||||
1024
|
||||
],
|
||||
"decoder_causal": false,
|
||||
"decoder_inject_noise": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
],
|
||||
"decoder_layers_per_block": [
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"decoder_spatial_padding_mode": "reflect",
|
||||
"decoder_spatio_temporal_scaling": [
|
||||
true,
|
||||
true,
|
||||
true
|
||||
],
|
||||
"down_block_types": [
|
||||
"LTX2VideoDownBlock3D",
|
||||
"LTX2VideoDownBlock3D",
|
||||
"LTX2VideoDownBlock3D",
|
||||
"LTX2VideoDownBlock3D"
|
||||
],
|
||||
"downsample_type": [
|
||||
"spatial",
|
||||
"temporal",
|
||||
"spatiotemporal",
|
||||
"spatiotemporal"
|
||||
],
|
||||
"encoder_causal": true,
|
||||
"encoder_spatial_padding_mode": "zeros",
|
||||
"in_channels": 3,
|
||||
"latent_channels": 128,
|
||||
"layers_per_block": [
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"out_channels": 3,
|
||||
"patch_size": 4,
|
||||
"patch_size_t": 1,
|
||||
"resnet_norm_eps": 1e-06,
|
||||
"scaling_factor": 1.0,
|
||||
"spatial_compression_ratio": 32,
|
||||
"spatio_temporal_scaling": [
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
],
|
||||
"temporal_compression_ratio": 8,
|
||||
"timestep_conditioning": false,
|
||||
"upsample_factor": [
|
||||
2,
|
||||
2,
|
||||
2
|
||||
],
|
||||
"upsample_residual": [
|
||||
true,
|
||||
true,
|
||||
true
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user