Add native transformers support (DINOv3ViT-compatible weights)
#2
by cherubicxn - opened
This PR adds native Transformers support alongside the existing reference checkpoint:
model.safetensors+config.jsonβ DINOv3ViT-compatible weights converted frommodel.pt(LingBot-Vision backbones are architecturally identical to the DINOv3 ViT implementation intransformers >= 4.56), loadable viaAutoModel.from_pretrained(...)with no custom codepreprocessor_config.jsonβ 512x512 bilinear resize + ImageNet normalization, matching the reference preprocessingREADME.mdβlibrary_name: transformers, a Transformers usage snippet, dual-format wording (also fixes the stalelbot_vision_inferimport in the existing snippet)
model.pt is unchanged and the reference lingbot_vision loader is unaffected.
Verification: converted weights are numerically equivalent to model.pt under the reference implementation (fp32, CPU): max |diff| = 2e-5 on patch/CLS tokens, including non-square inputs (dynamic RoPE). Load path tested on transformers 4.56.0 and 5.5.3. Conversion script: scripts/convert_to_transformers.py in the GitHub repo.
Hello @cherubicxn , Pablo from transformers team here, I think the tag dinov3 would also be worth being added! I tried and indeed the model works very well out-of-the-box with transformers π€