Skip to content

fix: update DINOv3ViTModel layer access for newer transformers versions#148

Open
shruthikha wants to merge 1 commit intomicrosoft:mainfrom
shruthikha:fix-transformers-layer-bug
Open

fix: update DINOv3ViTModel layer access for newer transformers versions#148
shruthikha wants to merge 1 commit intomicrosoft:mainfrom
shruthikha:fix-transformers-layer-bug

Conversation

@shruthikha
Copy link
Copy Markdown

This PR fixes a compatibility issue with newer versions of the transformers library.
The current implementation assumes that DINOv3ViTModel exposes layers via self.model.layer, which is no longer valid in recent versions. This results in an AttributeError:

'DINOv3ViTModel' object has no attribute 'layer'

The fix updates the access path to self.model.encoder.layer, which aligns with the current transformers architecture.
This change ensures that the image feature extractor works correctly without requiring users to downgrade their transformers version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant