Skip to content

Commit 35671db

Browse files
fix(inspect): use parent model_type for multimodal models in result
For multimodal models like CLIP, resolve_loader_config narrows the hf_config to a sub-config (e.g. CLIPTextConfig with model_type "clip_text_model"). The narrowed type is correct for internal registry lookups (TasksManager, I/O specs), but the user-facing InspectResult should show the parent model_type ("clip"). Use parent_hf_config.model_type for the display field while keeping the narrowed model_type for all internal resolution paths.
1 parent 299d352 commit 35671db

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/winml/modelkit/commands/inspect.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,14 @@ def _inspect_model_v2(
482482
task=task,
483483
)
484484

485+
# Use the parent model_type for the user-facing result. For multimodal
486+
# models (CLIP, etc.) `loader_config.model_type` is the narrowed sub-config
487+
# type (e.g. "clip_text_model"), but users expect the top-level type ("clip").
488+
display_model_type = getattr(parent_hf_config, "model_type", model_type)
489+
485490
return InspectResult(
486-
model_id=model_id or model_type or model_class_override or "unknown",
487-
model_type=model_type,
491+
model_id=model_id or display_model_type or model_class_override or "unknown",
492+
model_type=display_model_type,
488493
architectures=architectures,
489494
task=task,
490495
task_source=task_source,

0 commit comments

Comments
 (0)