[Model] update for mimo v25 (#41029)
Signed-off-by: zjy0516 <riverclouds.zhu@qq.com> Signed-off-by: Isotr0py <Isotr0py@outlook.com> Co-authored-by: Isotr0py <Isotr0py@outlook.com> Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
co-authored by
Isotr0py
Copilot
parent
c2e88a281c
commit
7a1eb8ac2e
@@ -439,7 +439,7 @@ th {
|
||||
| `Mamba2ForCausalLM` | Mamba2 | `mistralai/Mamba-Codestral-7B-v0.1`, etc. | | ✅︎ |
|
||||
| `MiMoForCausalLM` | MiMo | `XiaomiMiMo/MiMo-7B-RL`, etc. | ✅︎ | ✅︎ |
|
||||
| `MiMoV2FlashForCausalLM` | MiMoV2Flash | `XiaomiMiMo/MiMo-V2-Flash`, etc. | | ✅︎ |
|
||||
| `MiMoV2ProForCausalLM` | MiMoV2Pro | `XiaomiMiMo/MiMo-V2.5-Pro`, etc. | | ✅︎ |
|
||||
| `MiMoV2ForCausalLM` | MiMoV2Pro | `XiaomiMiMo/MiMo-V2.5-Pro`, etc. | | ✅︎ |
|
||||
| `MiniCPMForCausalLM` | MiniCPM | `openbmb/MiniCPM-2B-sft-bf16`, `openbmb/MiniCPM-2B-dpo-bf16`, `openbmb/MiniCPM-S-1B-sft`, etc. | ✅︎ | ✅︎ |
|
||||
| `MiniCPM3ForCausalLM` | MiniCPM3 | `openbmb/MiniCPM3-4B`, etc. | ✅︎ | ✅︎ |
|
||||
| `MiniMaxForCausalLM` | MiniMax-Text | `MiniMaxAI/MiniMax-Text-01-hf`, etc. | | |
|
||||
|
||||
@@ -594,8 +594,8 @@ _TEXT_GENERATION_EXAMPLE_MODELS = {
|
||||
"MiMoV2FlashForCausalLM": _HfExamplesInfo(
|
||||
"XiaomiMiMo/MiMo-V2-Flash", trust_remote_code=True
|
||||
),
|
||||
"MiMoV2ProForCausalLM": _HfExamplesInfo(
|
||||
"XiaomiMiMo/MiMo-V2.5-Pro", trust_remote_code=True, is_available_online=False
|
||||
"MiMoV2ForCausalLM": _HfExamplesInfo(
|
||||
"XiaomiMiMo/MiMo-V2.5-Pro", trust_remote_code=True
|
||||
),
|
||||
"Dots1ForCausalLM": _HfExamplesInfo("rednote-hilab/dots.llm1.inst"),
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ class SpeculativeConfig:
|
||||
)
|
||||
|
||||
if (arch := hf_config.architectures[0]) in (
|
||||
"MiMoV2ProForCausalLM",
|
||||
"MiMoV2ForCausalLM",
|
||||
"MiMoV2OmniForCausalLM",
|
||||
):
|
||||
from vllm.model_executor.models.mimo_v2_mtp import (
|
||||
@@ -347,7 +347,7 @@ class SpeculativeConfig:
|
||||
)
|
||||
|
||||
mtp_arch_maps = {
|
||||
"MiMoV2ProForCausalLM": "MiMoV2MTPModel",
|
||||
"MiMoV2ForCausalLM": "MiMoV2MTPModel",
|
||||
"MiMoV2OmniForCausalLM": "MiMoV2OmniMTPModel",
|
||||
}
|
||||
|
||||
|
||||
@@ -733,7 +733,7 @@ class MiMoV2FlashForCausalLM(nn.Module, SupportsPP, MixtureOfExperts):
|
||||
return loader.load_weights(weights)
|
||||
|
||||
|
||||
class MiMoV2ProForCausalLM(MiMoV2FlashForCausalLM):
|
||||
class MiMoV2ForCausalLM(MiMoV2FlashForCausalLM):
|
||||
packed_modules_mapping = {
|
||||
"qkv_proj": ["qkv_proj"],
|
||||
"gate_up_proj": ["gate_proj", "up_proj"],
|
||||
|
||||
@@ -172,7 +172,7 @@ _TEXT_GENERATION_MODELS = {
|
||||
"MPTForCausalLM": ("mpt", "MPTForCausalLM"),
|
||||
"MiMoForCausalLM": ("mimo", "MiMoForCausalLM"),
|
||||
"MiMoV2FlashForCausalLM": ("mimo_v2", "MiMoV2FlashForCausalLM"),
|
||||
"MiMoV2ProForCausalLM": ("mimo_v2", "MiMoV2ProForCausalLM"),
|
||||
"MiMoV2ForCausalLM": ("mimo_v2", "MiMoV2ForCausalLM"),
|
||||
"NemotronForCausalLM": ("nemotron", "NemotronForCausalLM"),
|
||||
"NemotronHForCausalLM": ("nemotron_h", "NemotronHForCausalLM"),
|
||||
"NemotronHPuzzleForCausalLM": ("nemotron_h", "NemotronHForCausalLM"),
|
||||
|
||||
@@ -458,6 +458,8 @@ def _strip_mimo_v2_attention_chunk_size(
|
||||
|
||||
class MimoV2ModelArchConfigConvertor(ModelArchConfigConvertorBase):
|
||||
def __init__(self, hf_config: PretrainedConfig, hf_text_config: PretrainedConfig):
|
||||
if getattr(hf_config, "vision_config", None):
|
||||
hf_config.architectures = ["MiMoV2OmniForCausalLM"]
|
||||
super().__init__(hf_config, hf_text_config)
|
||||
_strip_mimo_v2_attention_chunk_size(hf_config, hf_text_config)
|
||||
|
||||
@@ -542,7 +544,7 @@ MODEL_ARCH_CONFIG_CONVERTORS = {
|
||||
"qwen3_next_mtp": Qwen3NextMTPModelArchConfigConvertor,
|
||||
"qwen3_5_mtp": Qwen3_5MTPModelArchConfigConvertor,
|
||||
"mimo_mtp": MimoMTPModelArchConfigConvertor,
|
||||
"mimo_v2_pro": MimoV2ModelArchConfigConvertor,
|
||||
"mimo_v2": MimoV2ModelArchConfigConvertor,
|
||||
"mimo_v2_flash": MimoV2ModelArchConfigConvertor,
|
||||
"mimo_v2_mtp": MimoV2MTPModelArchConfigConvertor,
|
||||
"mimo_v2_omni_mtp": MimoV2MTPModelArchConfigConvertor,
|
||||
|
||||
Reference in New Issue
Block a user