Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 19 additions & 0 deletions optimum/exporters/openvino/model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4267,6 +4267,25 @@ class GPT2OpenVINOConfig(GPT2OnnxConfig):
_MODEL_PATCHER = OVDecoderModelPatcher


@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 +4270 to +4271
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)

class DinoV3OpenVINOConfig(VisionOnnxConfig):
MIN_TRANSFORMERS_VERSION = "4.55.0"


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"},
}
@register_in_tasks_manager(
"vision-encoder-decoder",
*[
Expand Down
1 change: 1 addition & 0 deletions tests/openvino/test_exporters_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class OVCLIExportTestCase(unittest.TestCase):
("feature-extraction", "sam"),
("text-to-audio", "speecht5"),
("zero-shot-image-classification", "clip"),
("feature-extraction", "vit-with-pooler"),
]

EXPECTED_NUMBER_OF_TOKENIZER_MODELS = {
Expand Down
1 change: 1 addition & 0 deletions tests/openvino/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,7 @@ def test_compare_to_transformers(self, model_arch):
class OVModelForCustomTasksIntegrationTest(unittest.TestCase):
SUPPORTED_ARCHITECTURES_WITH_ATTENTION = ["vit-with-attentions"]
SUPPORTED_ARCHITECTURES_WITH_HIDDEN_STATES = ["vit-with-hidden-states"]
SUPPORTED_ARCHITECTURES_WITH_HIDDEN_STATES = ["dinov3_vit"]

def _get_sample_image(self):
url = TEST_IMAGE_URL
Expand Down
1 change: 1 addition & 0 deletions tests/openvino/utils_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
"sana": "katuni4ka/tiny-random-sana",
"sana-sprint": "katuni4ka/tiny-random-sana-sprint",
"ltx-video": "katuni4ka/tiny-random-ltx-video",
"dinov3_vit": "snake7gun/tiny-random-dinov3",
}


Expand Down