-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure download stats work on Hugging Face, improve metadata #6
Conversation
Thank you very much for your suggestions! If there are updates I will let you know immediately. |
Hi @NielsRogge Thanks for your valuable suggestions. We've now:
Your assistance is greatly appreciated! Best, |
Thanks, looking great! Note that for download stats to work, you will need to run the code snippet above for each of the model repos (basically overwriting them). As the class now inherits from |
Noted, thanks for your contribution again! |
Hi @JulioZhao97 are you planning to run the script above? Cause I see downloads aren't working yet |
@NielsRogge Hello! I tested the script above at the time you submit the PR and I find model = YOLOv10.from_pretrained("juliozhao/DocLayout-YOLO-D4LA-from_scratch") requires |
@NielsRogge Hello! I tried |
Hi @JulioZhao97 I just tried, it works for me: https://huggingface.co/nielsr/DocLayout-YOLO-D4LA-from_scratch/tree/main Colab notebook: https://colab.research.google.com/drive/1N8Rfdu875lu5VCKG4uRUcM-Gi0o6qHom?usp=sharing. Perhaps you might need to update your |
Hey @JulioZhao97 how did you solve the pb to push to the hub ? Do you need to download the repo to do so as in Niels example ? |
@agombert which error are you encountering? |
@NielsRogge thanks for the quick answer model = YOLOv10.from_pretrained("juliozhao/DocLayout-YOLO-D4LA-from_scratch")
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[91], [line 1](vscode-notebook-cell:?execution_count=91&line=1)
----> [1](vscode-notebook-cell:?execution_count=91&line=1) model = YOLOv10.from_pretrained("juliozhao/DocLayout-YOLO-D4LA-from_scratch")
AttributeError: type object 'YOLOv10' has no attribute 'from_pretrained' It happens when I install |
Hi @wangbinDL,
Thanks for this nice work, great to see the models being released on the hub! Your paper was featured on the daily papers: https://huggingface.co/papers/2410.12628. Would be great to link the models to the paper.
To make download stats work, I wrote a PR similar to THU-MIG/yolov10#168 which I did for the YOLOv10 repository.
It leverages the PyTorchModelHubMixin developed by the 🤗 team to make sure a custom PyTorch model like yours:
from_pretrained
andpush_to_hub
methodsUsage is as follows:
Besides that, some more suggestions to improve the HF release:
Let me know whether you need any help!
Kind regards,
Niels from HF