Add PyTorchModelHubMixin
#7
by
nielsr
HF staff
- opened
Currently download metrics aren't working, this PR showcases the PyTorchModelHubMixin class which adds from_pretrained
and push_to_hub
capabilities to the model, along with download metrics.
The model is currently here: https://huggingface.co/nielsr/RMBG-1.4, but of course you could directly push to this repo
nielsr
changed pull request status to
open
I have found 3 problems with the transformers library when working with custom architectures and i'm working to fix them. As for how you can build your own custom architecture for HF, you can read my blogpost to find out how: https://huggingface.co/blog/not-lain/custom-architectures-with-huggingface
Thanks, note that there are 2 ways to get download metrics:
- either using the
PyTorchModelHubMixin
as shown in this PR. - either through the Transformers library, as shown in your PR (with
trust_remote_code=True
). Nice blog post btw!
Thanks a lot! Will close this one.
nielsr
changed pull request status to
closed