Repository navigation
Conversation
huggingface_hub 1.6.0 removed the direction argument from
HfApi.list_models, so select-top-models.py fails with a TypeError and
the weekly Build Top HuggingFace Models workflow can't select any
models. The argument was already deprecated ("Sorting is always
descending") and the Hub rejects any other direction, so dropping it
keeps the same ordering.
Also fix the comment on the else branch: ModelFilter was removed in
huggingface_hub 0.24, so that is the branch current versions take.
Fixes modelpack#534
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: shlok007 <14155445+shlok007@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #534
huggingface_hub 1.6.0 removed the
directionargument fromHfApi.list_models, soselect-top-models.pyfails with a TypeError. The weekly Build Top HuggingFace Models workflow has failed every run since 2026-03-08, two days after 1.6.0 came out. The argument was already deprecated ("Sorting is always descending") and the Hub rejects any other direction, so dropping it doesn't change the ordering.I also fixed the comment on the
elsebranch.ModelFilterwas removed in huggingface_hub 0.24, so that's the branch current versions take, not the older one.Tested locally on Python 3.13 with huggingface_hub 2.2.0, the version CI installs now. With the workflow's arguments (
--limit 10 --max-size 10 --sort-by downloads) it picks 10 models and the workflow's jq steps parse the output.--sort-by likesruns fine too, and so does huggingface_hub 0.20.0 (the minimum in requirements.txt), which goes through theModelFilterbranch.Separately,
--sort-by trendinggets a 400 from the Hub ("Invalid sort parameter: trending"). huggingface_hub calls that sorttrending_score. I left that out of this PR and can send a follow-up.🤖 Generated with Claude Code