-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Query models / datasets / spaces by tags (#498)
Fix #497 ## Query repos by tags Eg for gguf model, `listModels({search: {tags: ["gguf"]}})` For indonesian models, `listModels({search: {tags: ["id"]}})` For models stored in the EU, `listModels({search: {tags: ["region:eu"]}})` And so on. ## Request extra fields The `additionalFields` param, previously only available for `listSpaces`, is also available for `listModels` and `listDatasets`. It's also now strongly typed. So if you want to get the tags of the models you're listing: ```ts for await (const model of listModels({additionalFields: ["tags"]})) { console.log(model.tags); } ``` ## Limit the number of models requested You can specify the number of models to fetch, eg: ```ts for await (const model of listModels({limit: 2})) { console.log(model.tags); } ``` This will only fetch two models
- Loading branch information
1 parent
bea807a
commit ee6740d
Showing
8 changed files
with
414 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.