[Model] Add Moondream3 model support(only query and caption skills) (#32325)

Signed-off-by: Dong Wang <dongw2019@gmail.com>
This commit is contained in:
Dong W
2026-05-01 10:06:48 +08:00
committed by GitHub
parent 14043dfecd
commit 7198940b39
19 changed files with 3238 additions and 9 deletions
+14
View File
@@ -523,6 +523,17 @@ def dummy_hf_overrides(
text_config.update(update_dict)
# Update n_layers and moe configs for Moondream3 model
if model_arch in ("Moondream3ForCausalLM", "HfMoondream"):
text_config.update(
{
"n_layers": num_hidden_layers,
"moe_num_experts": num_experts,
"moe_experts_per_token": 2,
"moe_start_layer": num_hidden_layers,
}
)
if hasattr(hf_config, "vision_config"):
hf_config.vision_config.update(
{
@@ -531,6 +542,9 @@ def dummy_hf_overrides(
}
)
if model_arch in ("Moondream3ForCausalLM", "HfMoondream"):
hf_config.vision_config.update({"enc_n_layers": 1})
# e.g.: ibm-granite/granite-speech-3.3-2b
if hasattr(hf_config, "encoder_config"):
hf_config.encoder_config.update(