Fix AutoModel loading, add image processor and Apache-2.0 license

#5
by Slenser0 - opened

Hi, and thanks for releasing these models.

This follows up on the report on the SigLIP2-Base repo.

  • AutoModel.from_pretrained did not work. Every tensor was stored under a backbone. prefix left over from the training wrapper, which does not match Dinov2Model.base_model_prefix, so all 223 parameters were randomly initialised and only a warning was emitted. The tensors are now stored under their canonical names.
  • config.json. image_size: 518.
  • Image processor. Added preprocessor_config.json, copied unchanged from facebook/dinov2-small, so the repo is self-contained and the card no longer has to send users to another repository for preprocessing.
  • License. Added license: apache-2.0 and a LICENSE file (see below).

Verification

The reference is the wrapper this checkpoint was trained with: it is built from
facebook/dinov2-small and loaded from the published model.safetensors with
load_state_dict(strict=True) (0 missing / 0 unexpected keys). Its embeddings are then
compared against AutoModel.from_pretrained on the files in this PR.

check result
missing / unexpected / mismatched keys 0 / 0 / 0
max abs difference vs. that reference 0.0
embedding dimensionality 384
image processor output vs. facebook/dinov2-small identical (max abs diff 0.0)

No weight values change anywhere in this PR -- only tensor names, config.json and the card.

About the license

The repository currently has no license field and no LICENSE file, which is what prompted
the original question. This PR proposes Apache-2.0, matching the other public AvitoTech
models on the Hub and the Apache-2.0 base model(s) this is derived from -- but that call is
yours. If you would rather use different terms, say so and I will amend the PR; if you would
rather add the license yourself, feel free to drop the LICENSE file and the frontmatter
line from this PR and take just the loading fix.

AvitoTech1 changed pull request status to merged

Sign up or log in to comment