NeuralCarver / Michelangelo

[NeurIPS 2023] Michelangelo: Conditional 3D Shape Generation based on Shape-Image-Text Aligned Latent Representation
https://neuralcarver.github.io/michelangelo/
GNU General Public License v3.0
341 stars 11 forks source link

Integrate with huggingface #11

Open not-lain opened 5 months ago

not-lain commented 5 months ago

this pr will mainly add 3 methods to michelangelo

allowing your models to be easily integrated with huggingface using the PyTorchModelHubMixin class, I made this notebook https://colab.research.google.com/drive/1rStTsfAqoT7wXijt4a2wPbd6ZUYG3jTc?usp=sharing explaining how to migrate your weights by the end of the notebook, all users can load your model simply by

!!pip install -qU git+https://github.com/not-lain/Michelangelo.git@integrate-with-huggingface # or your main branch when this is merged
# no more renitializing the model and manually downloading the weights

from michelangelo.models.asl_diffusion.clip_asl_diffuser_pl_module import ClipASLDiffuser
# will instantiate the model and load the weights automatically
new_model = ClipASLDiffuser.from_pretrained("not-lain/Michelangelo")

Why you should integrate your model with huggingface ?

do not hesitate if you have any reviews on the pr or any questions.

Kind regards, Hafedh Hichri