-
Notifications
You must be signed in to change notification settings - Fork 301
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 inferenceProvider
filter when listing models
#1198
✨ Add inferenceProvider
filter when listing models
#1198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's wait for a @SBrandeis review to make sure the API is final
(following this PR to implement the same in huggingface_hub once settled) |
packages/hub/src/lib/list-models.ts
Outdated
@@ -63,6 +63,7 @@ export async function* listModels< | |||
owner?: string; | |||
task?: PipelineType; | |||
tags?: string[]; | |||
inferenceProvider?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can search for several providers at once
inferenceProvider?: string; | |
inferenceProvider?: string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing more than one provider raises an error:
Error: Internal Error - We're working hard to fix this as soon as possible!. URL: https://huggingface.co/api/models?limit=10&expand=pipeline_tag&expand=private&expand=gated&expand=downloads&expand=likes&expand=lastModified&expand=inferenceProviderMapping&inference_provider=together&inference_provider=replicate. Request ID: Root=1-67ae03c6-377f36e3001096932c7699a4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this URL it works:
https://huggingface.co/api/models?limit=10&expand=pipeline_tag&expand=private&expand=gated&expand=downloads&expand=likes&expand=lastModified&expand=inferenceProviderMapping&inference_provider=together,replicate
inference_provider=together,replicate
instead of inference_provider=together&inference_provider=replicate
That being said - this should not end up in a Server Error 😵 💫
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool. Thanks!. I thought the query param had the same syntax as the expand
one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the filter terms are combined with an OR clause, right? I mean inference_provider=together,replicate
returns models with one of those providers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it's an OR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I think it's ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @frascuchon !
This PR adds the missing query param
inference_provider
when listing models (listModels
).