Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EVA-02 model ( https://arxiv.org/abs/2303.11331 ) #2311

Merged
merged 3 commits into from
Jul 7, 2024

Conversation

v-espitalier
Copy link
Contributor

Hi,
I have implemented the EVA-02 model ( https://arxiv.org/abs/2303.11331 ), an improvement of the BeiT model (with a custom Y-shaped feed-forward, absolute positional encoding at beginning + rotate positional encoding in the attention module.
This model currently ranks first in ImageNet classification, according to timm.
( See: https://github.com/huggingface/pytorch-image-models/blob/main/results/results-imagenet.csv )
The weights provided are for ImageNet classification, and come from timm.

Thanks for your time,
Regards,
Vincent.

PS: As it was the case with the BeiT model implementation, there will be another commit / pull request later on, related to the rotate positional encoding. For now, I have included the weights as a single additional tensor, to the safetensor weights (+0.5 MB on top of 330 MB), instead of implementing the corresponding function. I am working on this, but it may take some time, as the missing function is not 'trivial'.

@LaurentMazare
Copy link
Collaborator

Thanks, looks good there was just a small clippy issue which I pushed a fix for.

@LaurentMazare LaurentMazare merged commit 9cd54aa into huggingface:main Jul 7, 2024
10 checks passed
@v-espitalier
Copy link
Contributor Author

Thank you @LaurentMazare for accepting this code and model, and sorry for the inconvenience about clippy.

Actually, I ran again clippy on my local code and I can't reproduce the clippy missing fix ( clippy warning missing floating number separator "_" )
Currently, I use the command '$ cargo clippy' (with default lints),
and cargo/cllippy version: clippy 0.1.79 (129f3b9 2024-06-10)
I also tried: '$ cargo clippy --all -- -D warns'

I wish to commit code that passes candle clippy test, in order to ease integration and save time.
How to reproduce the candle clippy test ? (Maybe it is written in Some(guidelines) for Candle developers, that I missed.)

Thanks for your time again,

@EricLBuehler
Copy link
Member

Perhaps you could run rustup update?

@v-espitalier
Copy link
Contributor Author

I just tried, and still have the 1.79.0 version, which does not raise the warning.
I also tried to reinstall rust ( curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh )

@v-espitalier
Copy link
Contributor Author

It seems 1.79.0 is the last version of clippy ( https://github.com/rust-lang/rust-clippy/tags ).
I am probably missing some command line arguments for clippy to make it stricter.

@LaurentMazare
Copy link
Collaborator

cargo clippy --tests --examples so that it also checks the tests and examples (the issue here was in an example so I guess this is what caused it).

@v-espitalier
Copy link
Contributor Author

Yes, that's it. I get the warnings. Thank you, I will be more careful from now on.
Best Regards,
Vncent.

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.

3 participants