Skip to content

DeepForest model library: Change path extensions to .safetensors and .json #1144

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

Merged
merged 2 commits into from
Jan 27, 2025
Merged

DeepForest model library: Change path extensions to .safetensors and .json #1144

merged 2 commits into from
Jan 27, 2025

Conversation

henrykironde
Copy link
Contributor

No description provided.

@julien-c julien-c changed the title Change path extensions to .safetensors and .json DeepForest model library: Change path extensions to .safetensors and .json Jan 27, 2025
@Wauplin
Copy link
Contributor

Wauplin commented Jan 27, 2025

Hi @henrykironde can you provide more details about this PR? Has anything being changed recently in DeepForest models? Looking at the files in https://huggingface.co/models?library=deepforest, it seems that counting only config.json files would be the way to go. We generally don't want to track downloads on both .safetensors AND .json files as that would count double (a user downloading once the model resulting in multiple counts).

@henrykironde
Copy link
Contributor Author

@Wauplin thanks for the quick response. I will quote our issue for more details below, weecology/DeepForest#896

The huggingface download stats are almost certainly too low (they currently show 13 downloads in the last month of the tree model. I suspect this is due to our change from a custom download system to the built-in .from_pretrained() combined with our attempts to track downloads.

We submitted code to model-libraries.ts that sets the tracking to occur when .pt and .pl files are downloaded:

But from_pretained is downloading .safetensors and (I believe) config.json.

So, I suspect this will all 'just work' if we remove the custom code from model-libraries.ts. Alternatively we could change the extensions to .json and .safetensors, but it feels like the default implementation is best if it works.

Copy link
Member

@Vaibhavs10 Vaibhavs10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, in that case we can just remove the count download rule - which is what we recommend libraries and apps building not the hub to do as well!

@julien-c
Copy link
Member

let's get those download numbers up 😁

@pcuenca pcuenca merged commit 7aa4daa into huggingface:main Jan 27, 2025
4 checks passed
@pcuenca
Copy link
Member

pcuenca commented Jan 31, 2025

Glad to see this working, @henrykironde @ethanwhite 🚀

Screenshot 2025-01-31 at 10 30 17

A couple of suggestions to improve the visitor experience, in case you have time:

  • You can open a PR to this repo to show code snippets for your library that would be shown when users click the "Use this model" button. Something concise like this would be great.
  • You can use gradio examples in your demo so visitors can test the models on a few sample images effortlessly. See for example this demo.
  • Visual examples in the model cards would also be great.

I just opened a small PR to your repo to clarify that downloads are coming from Hugging Face.

@ethanwhite
Copy link

That's more like what we were expecting! Thanks!

@henrykironde henrykironde deleted the henrykironde-new_extensions branch February 1, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants