[Bugfix] Add early validation to reject incompatible runner types for embedding models (#43079)

Signed-off-by: anish <anishesg@users.noreply.github.com>
Signed-off-by: Your Name <ak8686@princeton.edu>
Signed-off-by: anish <145943060+anishesg@users.noreply.github.com>
Co-authored-by: anish <anishesg@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
This commit is contained in:
anish
2026-05-21 11:07:46 -04:00
committed by GitHub
co-authored by anish Claude Opus 4.6 Wentao Ye
parent 9b9d5dbaab
commit 1c78f76c29
+9
View File
@@ -584,6 +584,15 @@ class ModelConfig:
architectures, self.runner_type, self.convert
)
if (
is_pooling_model
and not is_generative_model
and self.runner_type in ("draft", "generate")
):
raise ValueError(
f"Embedding models do not support `--runner {self.runner_type}`. "
"Use `--runner pooling` or `--runner auto` for embedding models."
)
if self.runner_type == "generate" and not is_generative_model:
generate_converts = _RUNNER_CONVERTS["generate"]
if self.convert_type not in generate_converts: