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 HF integration #49

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add HF integration #49

wants to merge 2 commits into from

Conversation

NielsRogge
Copy link

@NielsRogge NielsRogge commented Aug 26, 2024

Hi @Verg-Avesta and team,

Thanks for this nice work!

I wrote a quick PoC to showcase that you can easily have integration with the 🤗 hub so that you can automatically load the various CounTR models using from_pretrained (and push them using push_to_hub), track download numbers for your models (similar to models in the Transformers library), have nice model cards on a per-model basis, and leverage safetensors for serialization. It leverages the PyTorchModelHubMixin class which allows to inherits these methods.

This way, people can also find your models easier, as currently they are hosted on Google Drive.

Usage is as follows:

from models_mae_cross import SupervisedMAE

# load model
model = SupervisedMAE()

# load weights
model.load_state_dict(...)

# push to the hub
model.push_to_hub("your-hf-org-or-username/countr-finetuned-fsc147")

# reload
model = SupervisedMAE.from_pretrained("your-hf-org-or-username/countr-finetuned-fsc147")

This means people don't need to manually download a checkpoint first in their local environment, it just loads automatically from the hub.

Would you be interested in this integration?

Kind regards,

Niels

Note

Please don't merge this PR before pushing the model to the hub :)

@NielsRogge
Copy link
Author

I've also indexed the paper https://huggingface.co/papers/2208.13721, so that we can link the models to the paper.

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.

1 participant