Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions optimum/exporters/openvino/model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4537,3 +4537,25 @@ def patch_model_for_export(
self, model: Union["PreTrainedModel", "TFPreTrainedModel"], model_kwargs: Optional[Dict[str, Any]] = None
) -> "ModelPatcher":
return OVDecoderModelPatcher(self, model, model_kwargs=model_kwargs)


@register_in_tasks_manager("dinov3_vit", *["feature-extraction"], library_name="transformers")
@register_in_tasks_manager("dinov3_convnext", *["feature-extraction"], library_name="transformers")
Comment on lines 4286 to 4287
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding a tests for dinov3_vit! Would you mind adding a test for dinov3_convnext as well ? (to make sure support is not broken in the future)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also why not add the "image-classification" task ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dinov3 is not included in AutoModelForImageClassification.
Any suggestion ?

class OpenDinoV3OpenVINOConfig(VisionOnnxConfig):
MIN_TRANSFORMERS_VERSION = version.parse("4.55.0")

DEFAULT_ONNX_OPSET = 14

NORMALIZED_CONFIG_CLASS = NormalizedVisionConfig
@property
def inputs(self) -> Dict[str, Dict[int, str]]:
return {
"pixel_values": {0: "image_batch_size", 1: "num_channels", 2: "height", 3: "width"},
}

@property
def outputs(self) -> Dict[str, Dict[int, str]]:
return {
"last_hidden_state": {0: "image_batch_size"},
"pooler_output": {0: "image_batch_size"},
}
Loading