Skip to content

Conversation

@gusdlf93
Copy link

@gusdlf93 gusdlf93 commented Dec 6, 2025

Hello,
As mentioned in the related issue (#2622),
the CSATv2 model worked only in the HuggingFace environment and failed to load in a standard timm setup.

I updated the code, so that CSATv2 loads correctly through the timm registry.

Changed

  • Ensured that timm.create_model("csatv2") works without errors

Regarding model definition / pretrained_cfg / bits

  • I reviewed the maintainer’s comment and updated these parts to align with the timm API as best as I understood.

Validation

  • Model loads successfully in timm environment
  • train.py, validate.py works without any issues

Result (Imagenet 1K)

Model Acc@1 Acc@5 FLOPs#G MACs#G Params#M
csatv2 80.02% 94.9 2.77 1.38 11.1 M

If further adjustments are needed, I’m happy to revise the PR.
Thank you!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@gusdlf93
Copy link
Author

gusdlf93 commented Dec 7, 2025

Fix JIT compilation failure by replacing axis with dim

The PyTorch JIT compiler does not support the axis argument alias for torch.cat (and other operations), causing CI tests to fail with Keyword argument axis unknown.

I have replaced all instances of axis with dim to ensure the model is scriptable and compatible with the test suite.

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.

2 participants