Closed not-lain closed 2 months ago
This was indeed the easiest way for integration, but we're going for https://github.com/huggingface/huggingface.js/pull/785 as alternative
Nice work and thanks for the follow-up Niels ! I will proceed to closing this PR then.
@NielsRogge @not-lain PR https://github.com/huggingface/huggingface.js/pull/785 is nice to get at least code snippet + download count + "official library" but I think this PR is still relevant for long-term.
@LiheYoung @bingykang would you be up to have such an integration added to Depth-Anything-V2? As @not-lain explained, it would add a few nice features for end users (.from_pretrained
to directly load from the hub, .push_to_hub
for users finetuning/retraining the model, correct metadata on pushed models, etc). If you have any question, feel free to ask :hugs:
This pr mainly introduces a better way to push and load AI models from HuggingFace with ease using PyTorchModelHubMixin adding 3 methods to your model similar to how the transformers model operates which are :
perks of using PyTorchModelHubMixin :
Depth-Anything-V2
models exist on huggingface using the link : https://huggingface.co/models?other=Depth-Anything-V2you can also take a look at this colab notebook to set your huggingface repositories https://colab.research.google.com/drive/14jr-G280COi7YrFLtDp0J6VhBbTMgIZx?usp=sharing . Once this is all done all users can load your model using the following code :