fount-vlm-nell-02 0.3.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fount_vlm_nell_02-0.3.11.dist-info/METADATA +418 -0
- fount_vlm_nell_02-0.3.11.dist-info/RECORD +258 -0
- fount_vlm_nell_02-0.3.11.dist-info/WHEEL +5 -0
- fount_vlm_nell_02-0.3.11.dist-info/entry_points.txt +5 -0
- fount_vlm_nell_02-0.3.11.dist-info/licenses/LICENSE +21 -0
- fount_vlm_nell_02-0.3.11.dist-info/top_level.txt +1 -0
- mlx_vlm/__init__.py +16 -0
- mlx_vlm/__main__.py +24 -0
- mlx_vlm/chat.py +234 -0
- mlx_vlm/chat_ui.py +508 -0
- mlx_vlm/convert.py +284 -0
- mlx_vlm/deprecation.py +52 -0
- mlx_vlm/evals/__init__.py +0 -0
- mlx_vlm/evals/math_vista.py +565 -0
- mlx_vlm/evals/mmmu.py +528 -0
- mlx_vlm/evals/mmstar.py +343 -0
- mlx_vlm/evals/ocrbench.py +453 -0
- mlx_vlm/evals/utils.py +37 -0
- mlx_vlm/generate.py +1457 -0
- mlx_vlm/lora.py +207 -0
- mlx_vlm/models/__init__.py +0 -0
- mlx_vlm/models/aya_vision/__init__.py +2 -0
- mlx_vlm/models/aya_vision/aya_vision.py +188 -0
- mlx_vlm/models/aya_vision/config.py +52 -0
- mlx_vlm/models/aya_vision/language.py +202 -0
- mlx_vlm/models/aya_vision/vision.py +340 -0
- mlx_vlm/models/base.py +356 -0
- mlx_vlm/models/cache.py +238 -0
- mlx_vlm/models/deepseek_vl_v2/__init__.py +2 -0
- mlx_vlm/models/deepseek_vl_v2/config.py +159 -0
- mlx_vlm/models/deepseek_vl_v2/conversation.py +264 -0
- mlx_vlm/models/deepseek_vl_v2/deepseek_vl_v2.py +418 -0
- mlx_vlm/models/deepseek_vl_v2/language.py +539 -0
- mlx_vlm/models/deepseek_vl_v2/processing_deepsek_vl_v2.py +536 -0
- mlx_vlm/models/deepseek_vl_v2/vision.py +322 -0
- mlx_vlm/models/deepseekocr/__init__.py +2 -0
- mlx_vlm/models/deepseekocr/config.py +173 -0
- mlx_vlm/models/deepseekocr/conversation.py +264 -0
- mlx_vlm/models/deepseekocr/deepseekocr.py +371 -0
- mlx_vlm/models/deepseekocr/language.py +547 -0
- mlx_vlm/models/deepseekocr/processing_deepseekocr.py +655 -0
- mlx_vlm/models/deepseekocr/sam.py +489 -0
- mlx_vlm/models/deepseekocr/vision.py +263 -0
- mlx_vlm/models/deepseekocr_2/__init__.py +12 -0
- mlx_vlm/models/deepseekocr_2/config.py +216 -0
- mlx_vlm/models/deepseekocr_2/deepseekocr_2.py +297 -0
- mlx_vlm/models/deepseekocr_2/processing_deepseekocr.py +624 -0
- mlx_vlm/models/deepseekocr_2/vision.py +439 -0
- mlx_vlm/models/ernie4_5_moe_vl/__init__.py +5 -0
- mlx_vlm/models/ernie4_5_moe_vl/config.py +139 -0
- mlx_vlm/models/ernie4_5_moe_vl/ernie4_5_moe_vl.py +337 -0
- mlx_vlm/models/ernie4_5_moe_vl/language.py +770 -0
- mlx_vlm/models/ernie4_5_moe_vl/processor.py +686 -0
- mlx_vlm/models/ernie4_5_moe_vl/vision.py +322 -0
- mlx_vlm/models/fastvlm/__init__.py +2 -0
- mlx_vlm/models/fastvlm/config.py +79 -0
- mlx_vlm/models/fastvlm/fastvlm.py +198 -0
- mlx_vlm/models/fastvlm/language.py +49 -0
- mlx_vlm/models/fastvlm/vision.py +692 -0
- mlx_vlm/models/florence2/__init__.py +2 -0
- mlx_vlm/models/florence2/config.py +84 -0
- mlx_vlm/models/florence2/florence2.py +383 -0
- mlx_vlm/models/florence2/language.py +452 -0
- mlx_vlm/models/florence2/processing_florence2.py +30 -0
- mlx_vlm/models/florence2/vision.py +552 -0
- mlx_vlm/models/gemma3/__init__.py +2 -0
- mlx_vlm/models/gemma3/config.py +52 -0
- mlx_vlm/models/gemma3/gemma3.py +194 -0
- mlx_vlm/models/gemma3/language.py +293 -0
- mlx_vlm/models/gemma3/vision.py +215 -0
- mlx_vlm/models/gemma3n/__init__.py +2 -0
- mlx_vlm/models/gemma3n/audio.py +1038 -0
- mlx_vlm/models/gemma3n/config.py +130 -0
- mlx_vlm/models/gemma3n/gemma3n.py +322 -0
- mlx_vlm/models/gemma3n/language.py +631 -0
- mlx_vlm/models/gemma3n/vision.py +994 -0
- mlx_vlm/models/glm4v/__init__.py +3 -0
- mlx_vlm/models/glm4v/config.py +79 -0
- mlx_vlm/models/glm4v/glm4v.py +188 -0
- mlx_vlm/models/glm4v/language.py +574 -0
- mlx_vlm/models/glm4v/processing.py +220 -0
- mlx_vlm/models/glm4v/vision.py +406 -0
- mlx_vlm/models/glm4v_moe/__init__.py +3 -0
- mlx_vlm/models/glm4v_moe/config.py +81 -0
- mlx_vlm/models/glm4v_moe/glm4v_moe.py +176 -0
- mlx_vlm/models/glm4v_moe/language.py +674 -0
- mlx_vlm/models/glm4v_moe/processing.py +229 -0
- mlx_vlm/models/glm4v_moe/vision.py +405 -0
- mlx_vlm/models/glm_ocr/__init__.py +3 -0
- mlx_vlm/models/glm_ocr/config.py +93 -0
- mlx_vlm/models/glm_ocr/glm_ocr.py +180 -0
- mlx_vlm/models/glm_ocr/language.py +585 -0
- mlx_vlm/models/glm_ocr/processing.py +208 -0
- mlx_vlm/models/glm_ocr/vision.py +342 -0
- mlx_vlm/models/hunyuan_vl/__init__.py +7 -0
- mlx_vlm/models/hunyuan_vl/config.py +136 -0
- mlx_vlm/models/hunyuan_vl/hunyuan_vl.py +181 -0
- mlx_vlm/models/hunyuan_vl/language.py +509 -0
- mlx_vlm/models/hunyuan_vl/processing_hunyuan_vl.py +607 -0
- mlx_vlm/models/hunyuan_vl/vision.py +322 -0
- mlx_vlm/models/idefics2/__init__.py +2 -0
- mlx_vlm/models/idefics2/config.py +65 -0
- mlx_vlm/models/idefics2/idefics2.py +321 -0
- mlx_vlm/models/idefics2/language.py +161 -0
- mlx_vlm/models/idefics2/vision.py +244 -0
- mlx_vlm/models/idefics3/__init__.py +4 -0
- mlx_vlm/models/idefics3/config.py +54 -0
- mlx_vlm/models/idefics3/idefics3.py +221 -0
- mlx_vlm/models/idefics3/language.py +157 -0
- mlx_vlm/models/idefics3/vision.py +265 -0
- mlx_vlm/models/internvl_chat/__init__.py +3 -0
- mlx_vlm/models/internvl_chat/config.py +89 -0
- mlx_vlm/models/internvl_chat/internvl_chat.py +115 -0
- mlx_vlm/models/internvl_chat/language.py +187 -0
- mlx_vlm/models/internvl_chat/processor.py +395 -0
- mlx_vlm/models/internvl_chat/vision.py +265 -0
- mlx_vlm/models/interpolate.py +183 -0
- mlx_vlm/models/jina_vlm/__init__.py +3 -0
- mlx_vlm/models/jina_vlm/config.py +142 -0
- mlx_vlm/models/jina_vlm/image_processor.py +430 -0
- mlx_vlm/models/jina_vlm/jina_vlm.py +280 -0
- mlx_vlm/models/jina_vlm/language.py +272 -0
- mlx_vlm/models/jina_vlm/processing_jinavlm.py +266 -0
- mlx_vlm/models/jina_vlm/vision.py +202 -0
- mlx_vlm/models/kernels.py +447 -0
- mlx_vlm/models/kimi_vl/__init__.py +4 -0
- mlx_vlm/models/kimi_vl/config.py +84 -0
- mlx_vlm/models/kimi_vl/kimi_vl.py +127 -0
- mlx_vlm/models/kimi_vl/language.py +460 -0
- mlx_vlm/models/kimi_vl/processing_kimi_vl.py +560 -0
- mlx_vlm/models/kimi_vl/vision.py +485 -0
- mlx_vlm/models/lfm2_vl/__init__.py +2 -0
- mlx_vlm/models/lfm2_vl/config.py +94 -0
- mlx_vlm/models/lfm2_vl/language.py +49 -0
- mlx_vlm/models/lfm2_vl/lfm2_vl.py +223 -0
- mlx_vlm/models/lfm2_vl/processing_lfm2_vl.py +320 -0
- mlx_vlm/models/lfm2_vl/vision.py +223 -0
- mlx_vlm/models/llama4/__init__.py +2 -0
- mlx_vlm/models/llama4/config.py +83 -0
- mlx_vlm/models/llama4/language.py +334 -0
- mlx_vlm/models/llama4/llama4.py +146 -0
- mlx_vlm/models/llama4/vision.py +526 -0
- mlx_vlm/models/llava/__init__.py +2 -0
- mlx_vlm/models/llava/config.py +61 -0
- mlx_vlm/models/llava/language.py +200 -0
- mlx_vlm/models/llava/llava.py +132 -0
- mlx_vlm/models/llava/vision.py +233 -0
- mlx_vlm/models/llava_bunny/__init__.py +2 -0
- mlx_vlm/models/llava_bunny/config.py +85 -0
- mlx_vlm/models/llava_bunny/language.py +194 -0
- mlx_vlm/models/llava_bunny/llava_bunny.py +217 -0
- mlx_vlm/models/llava_bunny/vision.py +278 -0
- mlx_vlm/models/llava_next/__init__.py +2 -0
- mlx_vlm/models/llava_next/config.py +60 -0
- mlx_vlm/models/llava_next/language.py +192 -0
- mlx_vlm/models/llava_next/llava_next.py +138 -0
- mlx_vlm/models/llava_next/vision.py +217 -0
- mlx_vlm/models/mistral3/__init__.py +2 -0
- mlx_vlm/models/mistral3/config.py +59 -0
- mlx_vlm/models/mistral3/language.py +269 -0
- mlx_vlm/models/mistral3/mistral3.py +383 -0
- mlx_vlm/models/mllama/__init__.py +4 -0
- mlx_vlm/models/mllama/config.py +74 -0
- mlx_vlm/models/mllama/language.py +377 -0
- mlx_vlm/models/mllama/mllama.py +210 -0
- mlx_vlm/models/mllama/vision.py +458 -0
- mlx_vlm/models/molmo/__init__.py +5 -0
- mlx_vlm/models/molmo/config.py +93 -0
- mlx_vlm/models/molmo/language.py +208 -0
- mlx_vlm/models/molmo/molmo.py +108 -0
- mlx_vlm/models/molmo/processing_molmo.py +763 -0
- mlx_vlm/models/molmo/vision.py +408 -0
- mlx_vlm/models/molmo2/__init__.py +6 -0
- mlx_vlm/models/molmo2/config.py +137 -0
- mlx_vlm/models/molmo2/language.py +206 -0
- mlx_vlm/models/molmo2/molmo2.py +330 -0
- mlx_vlm/models/molmo2/processing.py +773 -0
- mlx_vlm/models/molmo2/vision.py +286 -0
- mlx_vlm/models/moondream2/__init__.py +11 -0
- mlx_vlm/models/moondream2/config.py +92 -0
- mlx_vlm/models/moondream2/image_crops.py +269 -0
- mlx_vlm/models/moondream2/language.py +267 -0
- mlx_vlm/models/moondream2/moondream2.py +522 -0
- mlx_vlm/models/moondream2/processing_moondream.py +144 -0
- mlx_vlm/models/moondream2/vision.py +200 -0
- mlx_vlm/models/multi_modality/__init__.py +4 -0
- mlx_vlm/models/multi_modality/config.py +108 -0
- mlx_vlm/models/multi_modality/language.py +191 -0
- mlx_vlm/models/multi_modality/multi_modality.py +338 -0
- mlx_vlm/models/multi_modality/sam.py +543 -0
- mlx_vlm/models/multi_modality/vision.py +450 -0
- mlx_vlm/models/paddleocr_vl/__init__.py +3 -0
- mlx_vlm/models/paddleocr_vl/config.py +93 -0
- mlx_vlm/models/paddleocr_vl/language.py +522 -0
- mlx_vlm/models/paddleocr_vl/paddleocr_vl.py +207 -0
- mlx_vlm/models/paddleocr_vl/processing_paddleocr_vl.py +425 -0
- mlx_vlm/models/paddleocr_vl/vision.py +358 -0
- mlx_vlm/models/paligemma/__init__.py +4 -0
- mlx_vlm/models/paligemma/config.py +50 -0
- mlx_vlm/models/paligemma/language.py +253 -0
- mlx_vlm/models/paligemma/paligemma.py +140 -0
- mlx_vlm/models/paligemma/vision.py +218 -0
- mlx_vlm/models/phi3_v/__init__.py +5 -0
- mlx_vlm/models/phi3_v/config.py +55 -0
- mlx_vlm/models/phi3_v/language.py +2 -0
- mlx_vlm/models/phi3_v/phi3_v.py +239 -0
- mlx_vlm/models/phi3_v/processing_phi3_v.py +704 -0
- mlx_vlm/models/phi3_v/vision.py +294 -0
- mlx_vlm/models/pixtral/__init__.py +4 -0
- mlx_vlm/models/pixtral/config.py +69 -0
- mlx_vlm/models/pixtral/language.py +195 -0
- mlx_vlm/models/pixtral/pixtral.py +208 -0
- mlx_vlm/models/pixtral/vision.py +293 -0
- mlx_vlm/models/qwen2_5_vl/__init__.py +2 -0
- mlx_vlm/models/qwen2_5_vl/config.py +90 -0
- mlx_vlm/models/qwen2_5_vl/language.py +541 -0
- mlx_vlm/models/qwen2_5_vl/qwen2_5_vl.py +184 -0
- mlx_vlm/models/qwen2_5_vl/vision.py +414 -0
- mlx_vlm/models/qwen2_vl/__init__.py +2 -0
- mlx_vlm/models/qwen2_vl/config.py +86 -0
- mlx_vlm/models/qwen2_vl/language.py +539 -0
- mlx_vlm/models/qwen2_vl/qwen2_vl.py +180 -0
- mlx_vlm/models/qwen2_vl/vision.py +308 -0
- mlx_vlm/models/qwen3_omni_moe/__init__.py +29 -0
- mlx_vlm/models/qwen3_omni_moe/audio.py +317 -0
- mlx_vlm/models/qwen3_omni_moe/code2wav.py +542 -0
- mlx_vlm/models/qwen3_omni_moe/config.py +264 -0
- mlx_vlm/models/qwen3_omni_moe/language.py +622 -0
- mlx_vlm/models/qwen3_omni_moe/omni_utils.py +69 -0
- mlx_vlm/models/qwen3_omni_moe/qwen3_omni_moe.py +706 -0
- mlx_vlm/models/qwen3_omni_moe/talker.py +873 -0
- mlx_vlm/models/qwen3_omni_moe/thinker.py +366 -0
- mlx_vlm/models/qwen3_omni_moe/vision.py +419 -0
- mlx_vlm/models/qwen3_vl/__init__.py +2 -0
- mlx_vlm/models/qwen3_vl/config.py +103 -0
- mlx_vlm/models/qwen3_vl/language.py +596 -0
- mlx_vlm/models/qwen3_vl/qwen3_vl.py +166 -0
- mlx_vlm/models/qwen3_vl/vision.py +441 -0
- mlx_vlm/models/qwen3_vl_moe/__init__.py +2 -0
- mlx_vlm/models/qwen3_vl_moe/config.py +108 -0
- mlx_vlm/models/qwen3_vl_moe/language.py +656 -0
- mlx_vlm/models/qwen3_vl_moe/qwen3_vl_moe.py +184 -0
- mlx_vlm/models/qwen3_vl_moe/vision.py +442 -0
- mlx_vlm/models/smolvlm/__init__.py +4 -0
- mlx_vlm/models/smolvlm/config.py +59 -0
- mlx_vlm/models/smolvlm/smolvlm.py +60 -0
- mlx_vlm/prompt_utils.py +565 -0
- mlx_vlm/sample_utils.py +39 -0
- mlx_vlm/server.py +1107 -0
- mlx_vlm/smolvlm_video_generate.py +109 -0
- mlx_vlm/tokenizer_utils.py +371 -0
- mlx_vlm/trainer/__init__.py +9 -0
- mlx_vlm/trainer/lora.py +70 -0
- mlx_vlm/trainer/trainer.py +299 -0
- mlx_vlm/trainer/utils.py +160 -0
- mlx_vlm/utils.py +1339 -0
- mlx_vlm/version.py +1 -0
- mlx_vlm/video_generate.py +611 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import inspect
|
|
2
|
+
from dataclasses import dataclass, field
|
|
3
|
+
from typing import Dict, List, Optional, Union
|
|
4
|
+
|
|
5
|
+
from ..base import BaseModelConfig
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dataclass
|
|
9
|
+
class Code2WavConfig(BaseModelConfig):
|
|
10
|
+
model_type: str = ""
|
|
11
|
+
hidden_size: int = 1024
|
|
12
|
+
intermediate_size: int = 3072
|
|
13
|
+
num_hidden_layers: int = 8
|
|
14
|
+
num_attention_heads: int = 16
|
|
15
|
+
num_key_value_heads: int = 16
|
|
16
|
+
decoder_dim: int = 1536
|
|
17
|
+
hidden_act: str = "silu"
|
|
18
|
+
attention_bias: bool = False
|
|
19
|
+
attention_dropout: float = 0.0
|
|
20
|
+
rms_norm_eps: float = 1e-05
|
|
21
|
+
rope_theta: float = 10000
|
|
22
|
+
max_position_embeddings: int = 8000
|
|
23
|
+
sliding_window: Optional[int] = 72
|
|
24
|
+
codebook_dim: int = 512
|
|
25
|
+
codebook_size: int = 2048
|
|
26
|
+
num_quantizers: int = 16
|
|
27
|
+
num_semantic_quantizers: int = 1
|
|
28
|
+
semantic_codebook_size: int = 4096
|
|
29
|
+
vector_quantization_hidden_dimension: int = 512
|
|
30
|
+
layer_scale_initial_scale: float = 0.01
|
|
31
|
+
upsample_rates: List[int] = field(default_factory=lambda: [8, 5, 4, 3])
|
|
32
|
+
upsampling_ratios: List[int] = field(default_factory=lambda: [2, 2])
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@dataclass
|
|
36
|
+
class AudioConfig(BaseModelConfig):
|
|
37
|
+
model_type: str = "qwen3_omni_moe_audio_encoder"
|
|
38
|
+
d_model: int = 1280
|
|
39
|
+
encoder_layers: int = 32
|
|
40
|
+
encoder_attention_heads: int = 20
|
|
41
|
+
encoder_ffn_dim: int = 5120
|
|
42
|
+
num_hidden_layers: int = 32
|
|
43
|
+
num_mel_bins: int = 128
|
|
44
|
+
output_dim: int = 2048
|
|
45
|
+
downsample_hidden_size: int = 480
|
|
46
|
+
activation_function: str = "gelu"
|
|
47
|
+
activation_dropout: float = 0.0
|
|
48
|
+
attention_dropout: float = 0.0
|
|
49
|
+
dropout: float = 0.0
|
|
50
|
+
initializer_range: float = 0.02
|
|
51
|
+
scale_embedding: bool = False
|
|
52
|
+
conv_chunksize: int = 500
|
|
53
|
+
n_window: int = 50
|
|
54
|
+
n_window_infer: int = 800
|
|
55
|
+
max_source_positions: int = 1500
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
@dataclass
|
|
59
|
+
class VisionConfig(BaseModelConfig):
|
|
60
|
+
model_type: str = "qwen3_omni_moe_vision_encoder"
|
|
61
|
+
depth: int = 27
|
|
62
|
+
hidden_size: int = 1152
|
|
63
|
+
intermediate_size: int = 4304
|
|
64
|
+
out_hidden_size: int = 2048
|
|
65
|
+
num_heads: int = 16
|
|
66
|
+
image_size: int = 768
|
|
67
|
+
patch_size: int = 16
|
|
68
|
+
spatial_patch_size: int = 16
|
|
69
|
+
spatial_merge_size: int = 2
|
|
70
|
+
temporal_patch_size: int = 2
|
|
71
|
+
tokens_per_second: int = 2
|
|
72
|
+
in_channels: int = 3
|
|
73
|
+
in_chans: int = 3
|
|
74
|
+
hidden_act: str = "gelu_pytorch_tanh"
|
|
75
|
+
initializer_range: float = 0.02
|
|
76
|
+
apply_vit_abs_pos_embed: bool = True
|
|
77
|
+
num_position_embeddings: int = 2304
|
|
78
|
+
deepstack_visual_indexes: List[int] = field(default_factory=lambda: [8, 16, 24])
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@dataclass
|
|
82
|
+
class TextConfig(BaseModelConfig):
|
|
83
|
+
num_hidden_layers: int
|
|
84
|
+
hidden_size: int
|
|
85
|
+
intermediate_size: int
|
|
86
|
+
num_attention_heads: int
|
|
87
|
+
num_experts: int
|
|
88
|
+
num_experts_per_tok: int
|
|
89
|
+
decoder_sparse_step: int
|
|
90
|
+
mlp_only_layers: List[int]
|
|
91
|
+
moe_intermediate_size: int
|
|
92
|
+
rms_norm_eps: float
|
|
93
|
+
vocab_size: int
|
|
94
|
+
num_key_value_heads: Optional[int]
|
|
95
|
+
head_dim: int
|
|
96
|
+
rope_theta: float
|
|
97
|
+
max_position_embeddings: int
|
|
98
|
+
model_type: str = "qwen3_omni_moe_text_encoder"
|
|
99
|
+
norm_topk_prob: bool = True
|
|
100
|
+
rope_scaling: Optional[Dict[str, Union[float, str, bool, List[int]]]] = field(
|
|
101
|
+
default_factory=lambda: {"type": "default"}
|
|
102
|
+
)
|
|
103
|
+
tie_word_embeddings: bool = False
|
|
104
|
+
attention_bias: bool = False
|
|
105
|
+
attention_dropout: float = 0.0
|
|
106
|
+
hidden_act: str = "silu"
|
|
107
|
+
use_cache: bool = True
|
|
108
|
+
use_sliding_window: bool = False
|
|
109
|
+
sliding_window: Optional[int] = None
|
|
110
|
+
shared_expert_intermediate_size: Optional[int] = None
|
|
111
|
+
router_aux_loss_coef: float = 0.001
|
|
112
|
+
use_qk_norm: bool = False
|
|
113
|
+
initializer_range: float = 0.02
|
|
114
|
+
|
|
115
|
+
def __post_init__(self):
|
|
116
|
+
if self.num_key_value_heads is None:
|
|
117
|
+
self.num_key_value_heads = self.num_attention_heads
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@dataclass
|
|
121
|
+
class CodePredictorConfig(BaseModelConfig):
|
|
122
|
+
model_type: str = "qwen3_omni_moe_talker_code_predictor"
|
|
123
|
+
num_hidden_layers: int = 5
|
|
124
|
+
hidden_size: int = 1024
|
|
125
|
+
intermediate_size: int = 3072
|
|
126
|
+
num_attention_heads: int = 16
|
|
127
|
+
num_key_value_heads: int = 8
|
|
128
|
+
head_dim: int = 128
|
|
129
|
+
hidden_act: str = "silu"
|
|
130
|
+
rms_norm_eps: float = 1e-06
|
|
131
|
+
rope_theta: float = 1000000
|
|
132
|
+
max_position_embeddings: int = 32768
|
|
133
|
+
vocab_size: int = 2048
|
|
134
|
+
num_code_groups: int = 16
|
|
135
|
+
max_window_layers: int = 28
|
|
136
|
+
attention_bias: bool = False
|
|
137
|
+
attention_dropout: float = 0.0
|
|
138
|
+
initializer_range: float = 0.02
|
|
139
|
+
use_cache: bool = True
|
|
140
|
+
layer_types: List[str] = field(default_factory=lambda: ["full_attention"] * 5)
|
|
141
|
+
rope_scaling: Optional[Dict[str, Union[float, str, bool, List[int]]]] = None
|
|
142
|
+
use_sliding_window: bool = False
|
|
143
|
+
sliding_window: Optional[int] = None
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
@dataclass
|
|
147
|
+
class ThinkerConfig(BaseModelConfig):
|
|
148
|
+
text_config: TextConfig
|
|
149
|
+
vision_config: VisionConfig
|
|
150
|
+
audio_config: AudioConfig
|
|
151
|
+
model_type: str = "qwen3_omni_moe_thinker"
|
|
152
|
+
dtype: str = "bfloat16"
|
|
153
|
+
initializer_range: float = 0.02
|
|
154
|
+
image_token_id: int = 151655
|
|
155
|
+
video_token_id: int = 151656
|
|
156
|
+
audio_token_id: int = 151675
|
|
157
|
+
audio_start_token_id: int = 151669
|
|
158
|
+
audio_end_token_id: int = 151670
|
|
159
|
+
vision_start_token_id: int = 151652
|
|
160
|
+
vision_end_token_id: int = 151653
|
|
161
|
+
user_token_id: int = 872
|
|
162
|
+
position_id_per_seconds: int = 13
|
|
163
|
+
seconds_per_chunk: int = 2
|
|
164
|
+
|
|
165
|
+
@classmethod
|
|
166
|
+
def from_dict(cls, params):
|
|
167
|
+
params = dict(params)
|
|
168
|
+
text_config = TextConfig.from_dict(params.pop("text_config", {}))
|
|
169
|
+
vision_config = VisionConfig.from_dict(params.pop("vision_config", {}))
|
|
170
|
+
audio_config = AudioConfig.from_dict(params.pop("audio_config", {}))
|
|
171
|
+
|
|
172
|
+
return cls(
|
|
173
|
+
text_config=text_config,
|
|
174
|
+
vision_config=vision_config,
|
|
175
|
+
audio_config=audio_config,
|
|
176
|
+
**{
|
|
177
|
+
k: v
|
|
178
|
+
for k, v in params.items()
|
|
179
|
+
if k in inspect.signature(cls).parameters
|
|
180
|
+
},
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
@dataclass
|
|
185
|
+
class TalkerConfig(BaseModelConfig):
|
|
186
|
+
text_config: TextConfig
|
|
187
|
+
code_predictor_config: CodePredictorConfig
|
|
188
|
+
model_type: str = "qwen3_omni_moe_talker"
|
|
189
|
+
accept_hidden_layer: int = 24
|
|
190
|
+
image_token_id: int = 151655
|
|
191
|
+
video_token_id: int = 151656
|
|
192
|
+
audio_token_id: int = 151675
|
|
193
|
+
audio_start_token_id: int = 151669
|
|
194
|
+
audio_end_token_id: int = 151670
|
|
195
|
+
vision_start_token_id: int = 151652
|
|
196
|
+
num_code_groups: int = 16
|
|
197
|
+
output_router_logits: bool = False
|
|
198
|
+
position_id_per_seconds: int = 13
|
|
199
|
+
seconds_per_chunk: int = 2
|
|
200
|
+
spatial_merge_size: int = 2
|
|
201
|
+
thinker_hidden_size: int = 2048
|
|
202
|
+
codec_bos_id: int = 2149
|
|
203
|
+
codec_eos_token_id: int = 2150
|
|
204
|
+
codec_nothink_id: int = 2155
|
|
205
|
+
codec_pad_id: int = 2148
|
|
206
|
+
codec_think_bos_id: int = 2156
|
|
207
|
+
codec_think_eos_id: int = 2157
|
|
208
|
+
speaker_id: Dict[str, int] = field(
|
|
209
|
+
default_factory=lambda: {"chelsie": 2301, "ethan": 2302, "aiden": 2303}
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
@classmethod
|
|
213
|
+
def from_dict(cls, params):
|
|
214
|
+
params = dict(params)
|
|
215
|
+
text_config = TextConfig.from_dict(params.pop("text_config", {}))
|
|
216
|
+
code_predictor_config = CodePredictorConfig.from_dict(
|
|
217
|
+
params.pop("code_predictor_config", {})
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
return cls(
|
|
221
|
+
text_config=text_config,
|
|
222
|
+
code_predictor_config=code_predictor_config,
|
|
223
|
+
**{
|
|
224
|
+
k: v
|
|
225
|
+
for k, v in params.items()
|
|
226
|
+
if k in inspect.signature(cls).parameters
|
|
227
|
+
},
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
@dataclass
|
|
232
|
+
class ModelConfig(BaseModelConfig):
|
|
233
|
+
thinker_config: ThinkerConfig
|
|
234
|
+
talker_config: TalkerConfig
|
|
235
|
+
code2wav_config: Code2WavConfig
|
|
236
|
+
model_type: str = "qwen3_omni_moe"
|
|
237
|
+
dtype: str = "bfloat16"
|
|
238
|
+
enable_audio_output: bool = True
|
|
239
|
+
im_start_token_id: int = 151644
|
|
240
|
+
im_end_token_id: int = 151645
|
|
241
|
+
system_token_id: int = 8948
|
|
242
|
+
user_token_id: int = 872
|
|
243
|
+
assistant_token_id: int = 77091
|
|
244
|
+
tts_bos_token_id: int = 151672
|
|
245
|
+
tts_eos_token_id: int = 151673
|
|
246
|
+
tts_pad_token_id: int = 151671
|
|
247
|
+
|
|
248
|
+
@classmethod
|
|
249
|
+
def from_dict(cls, params):
|
|
250
|
+
params = dict(params)
|
|
251
|
+
thinker_config = ThinkerConfig.from_dict(params.pop("thinker_config", {}))
|
|
252
|
+
talker_config = TalkerConfig.from_dict(params.pop("talker_config", {}))
|
|
253
|
+
code2wav_config = Code2WavConfig.from_dict(params.pop("code2wav_config", {}))
|
|
254
|
+
|
|
255
|
+
return cls(
|
|
256
|
+
thinker_config=thinker_config,
|
|
257
|
+
talker_config=talker_config,
|
|
258
|
+
code2wav_config=code2wav_config,
|
|
259
|
+
**{
|
|
260
|
+
k: v
|
|
261
|
+
for k, v in params.items()
|
|
262
|
+
if k in inspect.signature(cls).parameters
|
|
263
|
+
},
|
|
264
|
+
)
|