Skip to content
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

Add 'gated' search parameter #2448

Merged
merged 1 commit into from
Aug 14, 2024
Merged

Add 'gated' search parameter #2448

merged 1 commit into from
Aug 14, 2024

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Aug 14, 2024

Close #2427 cc @weigary

It is now possible to list models and datasets with gated=True or gated=False. By default (gated=None), all models/datasets are returned.

Example:

from huggingface_hub import HfApi

api = HfApi()

print("id, likes, downloads, gated")
for model in api.list_models(sort="likes7d", limit=5, gated=True, expand=["gated", "likes", "downloads"]):
    print(model.id, model.likes, model.downloads, model.gated)
id, likes, downloads, gated
black-forest-labs/FLUX.1-dev 1979 186639 auto
meta-llama/Meta-Llama-3.1-8B-Instruct 1778 1244445 manual
LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct 289 10889 auto
stabilityai/stable-diffusion-3-medium 3968 207853 auto
google/gemma-2-2b-it 418 113700 manual

(thanks to server-side implementation -private link-)

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Wauplin
Copy link
Contributor Author

Wauplin commented Aug 14, 2024

Thanks for the quick review :)

@Wauplin Wauplin merged commit 411e378 into main Aug 14, 2024
15 of 17 checks passed
@Wauplin Wauplin deleted the 2427-search-gated-repos branch August 14, 2024 10:18
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.

hfapi.list_models() support list the top K trending models for TGI/TEI/Diffusion models
3 participants