Open qubvel opened 3 weeks ago
Hi Pavel, thanks for reaching out and being interested in our work. Yes, I'd love to integrate the model weights into the hugging face hub!
Awesome, let me know if you have any questions! Just ping me in this issue 🤗
Hi @siyuanliii,
Thanks for this great work! I am excited for the code release!
I am reaching you about the integration with the 🤗 hub from day 0, so you can track the download number, have a nice model card and anyone can automatically load the model using
from_pretrained
(and push it usingpush_to_hub
, similar to models in the Transformers library). It leverages the PyTorchModelHubMixin class which allows to inherit these methods.Usage can be as follows:
This means people don't need to manually download a checkpoint first in their local environment, it just loads it automatically from the hub. The
safetensors
format is used to ensure safe serialization of the weights rather than pickle.Integration usually is really simple, you just need to subclass your PyTorch model class from
nn.Module
together with PyTorchModelHubMixin class. For example:Then, you will be able to push the pretrained model to the hub to make it discoverable:
Would you consider this integration? Please, let me know if you have any questions or concerns!
Thank you, Pavel Iakubovskii ML Engineer @ HF 🤗