style: playground collapse button

This commit is contained in:
jialin
2024-07-30 18:11:21 +08:00
parent 64f60b48cf
commit cfdc731313
7 changed files with 92 additions and 29 deletions
+18 -1
View File
@@ -1,4 +1,4 @@
import { listFiles } from '@huggingface/hub';
import { listFiles, listModels } from '@huggingface/hub';
import { request } from '@umijs/max';
import {
FormData,
@@ -116,6 +116,23 @@ export async function callHuggingfaceQuickSearch(params: any) {
});
}
export async function queryHuggingfaceModels(params: {
search: {
query: string;
tags: string[];
};
}) {
const result = [];
for await (const model of listModels({
...params,
limit: 100,
additionalFields: ['author']
})) {
result.push(model);
}
return result;
}
export async function queryHuggingfaceModelFiles(params: { repo: string }) {
const result = [];
for await (const fileInfo of listFiles(params)) {