Skip to content

Conversation

@ariG23498
Copy link
Contributor

CC: @pcuenca (from our conversation about image matching models repository)

For others:

  1. The mother issue: Add models to Hugging Face Hub alexstoken/image-matching-models#45
  2. The image matching models org: https://huggingface.co/image-matching-models
  3. I would like to tag the models on the org with image-matching-models and that would count the safetensors download

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Looks good to me (with minor comment).

Orthogonal topic but note that I have opened https://huggingface.co/image-matching-models/eloftr/discussions/1 to remove the duplicated file called eloftr_outdoors.safetensors (with a blank space at the end).

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

Looks good to me! Agree with @Wauplin's suggestions.

Co-authored-by: Lucain <lucainp@gmail.com>
@ariG23498
Copy link
Contributor Author

Thanks @Wauplin and @pcuenca
I have taken care of the comments and the PR to the Hub repo.

Question: After merging this PR, do we need to add this label image-matching-models as the library-name or as a tag? Upon knowing this, I will be able to update the authors as well.

@pcuenca
Copy link
Member

pcuenca commented Nov 18, 2025

library_name, so the downloads rule kicks into effect.

@Wauplin
Copy link
Contributor

Wauplin commented Nov 18, 2025

@ariG23498 @pcuenca For the record for next time, the Hub backend has the concepts of "main library" and "other libraries". The main library is the one used to count downloads on the repo. The "main libraries" + the "other libraries" are used to display code snippets on a model page. A good example to illustrate this is the sentence-transformers models. Most of them are both tagged as sentence-transformers AND as transformers. If you look at https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2, you will see that:

image

So all of this to say, a model can be linked to several libraries but only 1 of them is the "main one". In practice, the Hub backend will first check the library_name. If it exists, it is considered as the main library even if it is not registered in this repo. It will show up as library_name in the /api/models/<model-id> endpoint. Then, we iterate over all tags to find all library candidates (based on the list from this repo). The first match is considered as the main library_name (if this field is not already explicitly populated), the rest is considered as "other libraries" and will show in the tag lists and snippets dropdown.

Getting back to the original question:

do we need to add this label image-matching-models as the library-name or as a tag?

Since it has a single library, no matter if you set it in the model cards' library_name field or tags field, it will be picked as the library_name by the backend. It is still recommended to use explicitly the library_name field for the sake of consistency.

Hope this makes it all clear! Let's merge the PR now, it should be live on the Hub within a few days ;)

@Wauplin Wauplin merged commit 1f0b665 into huggingface:main Nov 18, 2025
4 checks passed
@pcuenca
Copy link
Member

pcuenca commented Nov 18, 2025

Thanks a lot for taking the time to explain everything so clearly @Wauplin! 🙌

My shortcut way of thinking was to use library_name as the preferred way to go because image-matching-models is really a wrapper over various other libraries, and if users set those libraries as additional tags we may end up in a situation where we could "shadow" the counting rule.

This is great information to share with these authors and other prospective collabs.

@Wauplin
Copy link
Contributor

Wauplin commented Nov 18, 2025

My shortcut way of thinking was to use library_name as the preferred way to go because image-matching-models is really a wrapper over various other libraries, and if users set those libraries as additional tags we may end up in a situation where we could "shadow" the counting rule.

Then this is an even better reason to use the library_name field yes! Otherwise we would rely on the order of the tags list which is much more error prone.

Glad explanations helped! 🤗

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.

3 participants