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 a method to get the list of cached models #784

Merged
merged 3 commits into from
Feb 17, 2025
Merged

Conversation

dacorvo
Copy link
Collaborator

@dacorvo dacorvo commented Feb 12, 2025

This adds a method to get the list of cached models for the current optimum version as a set of (model_arch, model_org, model_name).

This adds a method to get the list of cached models for the current
optimum version as a set of (model_arch, model_org, model_name).
@dacorvo dacorvo marked this pull request as ready for review February 12, 2025 16:18
@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.

Comment on lines 484 to 486
if len(sub_paths) == len(root_sub_paths) + 4:
model_arch, model_org, model_name = sub_paths[-4:-1]
cached_models.add((model_arch, model_org, model_name))
Copy link
Member

Choose a reason for hiding this comment

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

Why 4?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a comment

Copy link
Member

@michaelbenayoun michaelbenayoun left a comment

Choose a reason for hiding this comment

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

LGTM

@dacorvo dacorvo merged commit cec92ce into main Feb 17, 2025
10 of 11 checks passed
@dacorvo dacorvo deleted the get_hub_cached_models branch February 17, 2025 15:10
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