nicoboou / chadavit

Official PyTorch implementation of ChAda-ViT [CVPR 2024]
Apache License 2.0
28 stars 1 forks source link

Model weights #1

Closed MoSuunny closed 4 months ago

MoSuunny commented 5 months ago

Hello, Could you please let me know if there's a place where we can download the model's weight? The hugging face link doesn't work.

nicoboou commented 5 months ago

hi, I've uploaded a link redirecting to the weights and the model refactored for HuggingFace transformers library in the README.md. Link: https://huggingface.co/nicoboou/chadavit16-moyen

MoSuunny commented 5 months ago

Hi! Thank you I have tried to download the weight with following code

Load model directly

from transformers import AutoModel model = AutoModel.from_pretrained("nicoboou/chadavit16-moyen", trust_remote_code=True)

But it says Traceback (most recent call last): File "/lustre/scratch126/cellgen/team361/mv10/chada_vit_download/download.py", line 6, in model = AutoModel.from_pretrained("nicoboou/chadavit16-moyen", cache_dir ='.', trust_remote_code=True) File "/nfs/team361/mv10/.chada_vit/my-venv-name/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 550, in from_pretrained model_class = get_class_from_dynamic_module( File "/nfs/team361/mv10/.chada_vit/my-venv-name/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 489, in get_class_from_dynamic_module final_module = get_cached_module_file( File "/nfs/team361/mv10/.chada_vit/my-venv-name/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 315, in get_cached_module_file modules_needed = check_imports(resolved_module_file) File "/nfs/team361/mv10/.chada_vit/my-venv-name/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 180, in check_imports raise ImportError( ImportError: This modeling file requires the following packages that were not found in your environment: chada_vit. Run pip install chada_vit

I think it should be because of following two lines of code in modeling_chada_vit.py

from chada_vit.utils.misc import truncnormal from chada_vit.config_chada_vit import ChAdaViTConfig

I think when we install dependency with poetry it doesn't include the source itself but I don't know how to fix it or it should be solved from your side.

Could you please help me with that.

abebe9849 commented 5 months ago

same error...

nicoboou commented 4 months ago

hi @MoSuunny @abebe9849, in order to provide a more straightforward way of using our model, i provided two additional elements in repo:

i'm also working on a stable version on HuggingFace, should arrive anytime

nicoboou commented 4 months ago

@MoSuunny pls indicate if i can close this thks

MoSuunny commented 4 months ago

Hello!

I was able to download it and it works.

Thank you :).