Make sure download metrics work on HF, add better discoverability #78
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear authors,
I noticed your awesome repository trending on paperswithcode. I'm from Hugging Face, and I see all checkpoints are on π€
already, but present in a single repository, which means download metrics won't work. π
This PR resolves that by showcasing the PyTorchModelHubMixin class, which is a minimal class that allows to easily add functionalities like
from_pretrained
,save_pretrained
, andpush_to_hub
to any customnn.Module
!Similar to models in the Transformers/Diffusers library, it allows to push and reload models in the format of
safetensors
(for the weights) and aconfig.json
(for the model's configuration). It also creates an automated model card, along with tags for better discoverability of your models. Usage is as follows:The corresponding model is here for now: https://huggingface.co/nielsr/gigaHalfLibri330M_TTSEnhanced_max16s, but I could transfer it (along with the other checkpoints) to your organization.
This ensures:
β download metrics will work for you
β tags are added to the model card automatically which means people can easier find the models on the hub (better discoverability)
β reloading the model is just a single line of code
Here's a notebook regarding how I did that :)
Btw, there's no need for a wget in the demo notebooks, you can leverage hf_hub_download to load a file in a single line of code! This is also illustrated in my notebook above.
Would you be interested in this integration?
Kind regards,
Niels
ML @ HF