Skip to content

Add OwlV2 to NormalizedConfigManager - #2515

Open
kratos0718 wants to merge 1 commit into
huggingface:mainfrom
kratos0718:add-owlv2-normalized-config
Open

kratos0718 wants to merge 1 commit into
huggingface:mainfrom
kratos0718:add-owlv2-normalized-config

Conversation

@kratos0718

Copy link
Copy Markdown

Summary

Part of #351. OwlV2 already has an ONNX export config but was missing from NormalizedConfigManager.

  • Added "owlv2": Pix2StructNormalizedTextConfig to _conf (alphabetically, between opt and pegasus)
  • Removed owlv2 from the TODO: missing normalized configs comment

Same dual text/vision encoder shape as GroupViT (#2513) and OwlViT (#2514), both also open — carries the same NormalizedTextAndVisionConfig.__getattr__ fix, for the same reason (.num_layers needs to resolve to num_hidden_layers on the nested text_config, and the class wasn't doing that before). See #2513 for the full explanation.

Test plan

  • Added test_owlv2_normalizes_expected_attributes, instantiating a real Owlv2Config() and asserting hidden_size/num_attention_heads/num_layers/image_size/num_channels resolve correctly
  • Carried the same Pix2Struct regression test
  • Ran the full test file locally (python -m unittest) — all 3 tests pass

…onConfig fix

OwlV2 has an ONNX export config but was missing from NormalizedConfigManager.
Same dual text/vision encoder shape as GroupViT/OwlViT/Pix2Struct, registered
via Pix2StructNormalizedTextConfig.

Carries the same NormalizedTextAndVisionConfig.__getattr__ fix as huggingface#2513 and
huggingface#2514 for the same reason: OwlV2's text_config only has num_hidden_layers,
not a num_layers alias.
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