Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
fix build
Browse files- utils/datas/api_collections.ts +338 -278
utils/datas/api_collections.ts
CHANGED
@@ -1,290 +1,350 @@
|
|
1 |
import { ApiCollection } from "@/utils/type";
|
2 |
|
3 |
-
export const API_COLLECTIONS: Array<ApiCollection> = [
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
method: 'GET',
|
8 |
-
path: '/api/models',
|
9 |
-
parameters: {
|
10 |
-
search: "",
|
11 |
-
author: "",
|
12 |
-
filter: "",
|
13 |
-
sort: "",
|
14 |
-
direction: "",
|
15 |
-
limit: 5,
|
16 |
-
full: true,
|
17 |
-
config: true,
|
18 |
-
inference_provider: "",
|
19 |
-
expand[]: ""
|
20 |
-
},
|
21 |
-
tooltips: {
|
22 |
-
search: "Filter based on substrings for repos and their usernames, such as resnet or microsoft",
|
23 |
-
full: "Whether to fetch most model data, such as all tags, the files, etc.",
|
24 |
-
config: "Whether to also fetch the repo config.",
|
25 |
-
filter: "Filter based on tags, such as text-classification or spacy.",
|
26 |
-
inference_provider: "Filter based on the available inference providers for the model (https://huggingface.co/docs/huggingface_hub/en/guides/inference#supported-providers-and-tasks).",
|
27 |
-
expand[]: "Expand the model attributes. For example, you can get the supported provides with 'expand[]=inferenceProviderMapping'.",
|
28 |
-
}
|
29 |
-
}, {
|
30 |
-
method: 'GET',
|
31 |
-
path: '/api/models/{repo_id}'
|
32 |
-
}, {
|
33 |
-
method: 'GET',
|
34 |
-
path: '/api/models-tags-by-type'
|
35 |
-
}, {
|
36 |
-
method: 'GET',
|
37 |
-
path: '/api/datasets',
|
38 |
-
parameters: {
|
39 |
-
search: "",
|
40 |
-
author: "",
|
41 |
-
filter: "",
|
42 |
-
sort: "",
|
43 |
-
direction: "",
|
44 |
-
limit: 5,
|
45 |
-
full: true,
|
46 |
-
},
|
47 |
-
tooltips: {
|
48 |
-
search: "Filter based on substrings for repos and their usernames, such as pets or microsoft",
|
49 |
-
full: "Whether to fetch most model data, such as all tags, the files, etc.",
|
50 |
-
config: "Whether to also fetch the repo config.",
|
51 |
-
filter: "Filter based on tags, such as task_categories:text-classification or languages:en."
|
52 |
-
}
|
53 |
-
}, {
|
54 |
-
method: 'GET',
|
55 |
-
path: '/api/datasets/{repo_id}',
|
56 |
-
parameters: {
|
57 |
-
full: true,
|
58 |
-
},
|
59 |
-
tooltips: {
|
60 |
-
full: "Whether to fetch most dataset data, such as all tags, the files, etc.",
|
61 |
-
}
|
62 |
-
}, {
|
63 |
-
method: 'GET',
|
64 |
-
path: '/api/datasets/{repo_id}/croissant'
|
65 |
-
},{
|
66 |
-
method: 'GET',
|
67 |
-
path: '/api/datasets/{repo_id}/parquet'
|
68 |
-
}, {
|
69 |
-
method: 'GET',
|
70 |
-
path: '/api/datasets/{repo_id}/parquet/{config}/{split}/{n}.parquet'
|
71 |
-
}, {
|
72 |
-
method: 'GET',
|
73 |
-
path: '/api/datasets-tags-by-type'
|
74 |
-
}, {
|
75 |
-
method: 'GET',
|
76 |
-
path: '/api/spaces',
|
77 |
-
parameters: {
|
78 |
-
search: "",
|
79 |
-
author: "",
|
80 |
-
filter: "",
|
81 |
-
sort: "",
|
82 |
-
direction: "",
|
83 |
-
limit: 5,
|
84 |
-
full: true,
|
85 |
-
},
|
86 |
-
tooltips: {
|
87 |
-
search: "Filter based on substrings for repos and their usernames, such as resnet or microsoft",
|
88 |
-
full: "Whether to fetch most model data, such as all tags, the files, etc.",
|
89 |
-
config: "Whether to also fetch the repo config.",
|
90 |
-
filter: "Filter based on tags, such as text-classification or spacy."
|
91 |
-
}
|
92 |
-
}, {
|
93 |
-
method: 'GET',
|
94 |
-
path: '/api/spaces/{repo_id}'
|
95 |
-
}, {
|
96 |
-
method: 'GET',
|
97 |
-
path: '/api/metrics'
|
98 |
-
}],
|
99 |
-
},
|
100 |
-
{
|
101 |
-
key: 'repo',
|
102 |
-
endpoints: [{
|
103 |
-
method: 'POST',
|
104 |
-
path: '/api/repos/create',
|
105 |
-
body: [
|
106 |
{
|
107 |
-
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
},
|
111 |
{
|
112 |
-
|
113 |
-
|
114 |
-
required: true,
|
115 |
},
|
116 |
{
|
117 |
-
|
118 |
-
|
119 |
-
key: "organization",
|
120 |
},
|
121 |
{
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
},
|
125 |
{
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
|
|
|
|
|
|
130 |
},
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
}
|
290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import { ApiCollection } from "@/utils/type";
|
2 |
|
3 |
+
export const API_COLLECTIONS: Array<ApiCollection> = [
|
4 |
+
{
|
5 |
+
key: "search",
|
6 |
+
endpoints: [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
{
|
8 |
+
method: "GET",
|
9 |
+
path: "/api/models",
|
10 |
+
parameters: {
|
11 |
+
search: "",
|
12 |
+
author: "",
|
13 |
+
filter: "",
|
14 |
+
sort: "",
|
15 |
+
direction: "",
|
16 |
+
limit: 5,
|
17 |
+
full: true,
|
18 |
+
config: true,
|
19 |
+
inference_provider: "",
|
20 |
+
expand: "",
|
21 |
+
},
|
22 |
+
tooltips: {
|
23 |
+
search:
|
24 |
+
"Filter based on substrings for repos and their usernames, such as resnet or microsoft",
|
25 |
+
full: "Whether to fetch most model data, such as all tags, the files, etc.",
|
26 |
+
config: "Whether to also fetch the repo config.",
|
27 |
+
filter: "Filter based on tags, such as text-classification or spacy.",
|
28 |
+
inference_provider:
|
29 |
+
"Filter based on the available inference providers for the model (https://huggingface.co/docs/huggingface_hub/en/guides/inference#supported-providers-and-tasks).",
|
30 |
+
expand:
|
31 |
+
"Expand the model attributes. For example, you can get the supported provides with 'expand[]=inferenceProviderMapping'.",
|
32 |
+
},
|
33 |
},
|
34 |
{
|
35 |
+
method: "GET",
|
36 |
+
path: "/api/models/{repo_id}",
|
|
|
37 |
},
|
38 |
{
|
39 |
+
method: "GET",
|
40 |
+
path: "/api/models-tags-by-type",
|
|
|
41 |
},
|
42 |
{
|
43 |
+
method: "GET",
|
44 |
+
path: "/api/datasets",
|
45 |
+
parameters: {
|
46 |
+
search: "",
|
47 |
+
author: "",
|
48 |
+
filter: "",
|
49 |
+
sort: "",
|
50 |
+
direction: "",
|
51 |
+
limit: 5,
|
52 |
+
full: true,
|
53 |
+
},
|
54 |
+
tooltips: {
|
55 |
+
search:
|
56 |
+
"Filter based on substrings for repos and their usernames, such as pets or microsoft",
|
57 |
+
full: "Whether to fetch most model data, such as all tags, the files, etc.",
|
58 |
+
config: "Whether to also fetch the repo config.",
|
59 |
+
filter:
|
60 |
+
"Filter based on tags, such as task_categories:text-classification or languages:en.",
|
61 |
+
},
|
62 |
},
|
63 |
{
|
64 |
+
method: "GET",
|
65 |
+
path: "/api/datasets/{repo_id}",
|
66 |
+
parameters: {
|
67 |
+
full: true,
|
68 |
+
},
|
69 |
+
tooltips: {
|
70 |
+
full: "Whether to fetch most dataset data, such as all tags, the files, etc.",
|
71 |
+
},
|
72 |
},
|
73 |
+
{
|
74 |
+
method: "GET",
|
75 |
+
path: "/api/datasets/{repo_id}/croissant",
|
76 |
+
},
|
77 |
+
{
|
78 |
+
method: "GET",
|
79 |
+
path: "/api/datasets/{repo_id}/parquet",
|
80 |
+
},
|
81 |
+
{
|
82 |
+
method: "GET",
|
83 |
+
path: "/api/datasets/{repo_id}/parquet/{config}/{split}/{n}.parquet",
|
84 |
+
},
|
85 |
+
{
|
86 |
+
method: "GET",
|
87 |
+
path: "/api/datasets-tags-by-type",
|
88 |
+
},
|
89 |
+
{
|
90 |
+
method: "GET",
|
91 |
+
path: "/api/spaces",
|
92 |
+
parameters: {
|
93 |
+
search: "",
|
94 |
+
author: "",
|
95 |
+
filter: "",
|
96 |
+
sort: "",
|
97 |
+
direction: "",
|
98 |
+
limit: 5,
|
99 |
+
full: true,
|
100 |
+
},
|
101 |
+
tooltips: {
|
102 |
+
search:
|
103 |
+
"Filter based on substrings for repos and their usernames, such as resnet or microsoft",
|
104 |
+
full: "Whether to fetch most model data, such as all tags, the files, etc.",
|
105 |
+
config: "Whether to also fetch the repo config.",
|
106 |
+
filter: "Filter based on tags, such as text-classification or spacy.",
|
107 |
+
},
|
108 |
+
},
|
109 |
+
{
|
110 |
+
method: "GET",
|
111 |
+
path: "/api/spaces/{repo_id}",
|
112 |
+
},
|
113 |
+
{
|
114 |
+
method: "GET",
|
115 |
+
path: "/api/metrics",
|
116 |
+
},
|
117 |
+
],
|
118 |
+
},
|
119 |
+
{
|
120 |
+
key: "repo",
|
121 |
+
endpoints: [
|
122 |
+
{
|
123 |
+
method: "POST",
|
124 |
+
path: "/api/repos/create",
|
125 |
+
body: [
|
126 |
+
{
|
127 |
+
label: "Type of repo (dataset or space; model by default)",
|
128 |
+
key: "type",
|
129 |
+
required: true,
|
130 |
+
},
|
131 |
+
{
|
132 |
+
label: "Name of repo",
|
133 |
+
key: "name",
|
134 |
+
required: true,
|
135 |
+
},
|
136 |
+
{
|
137 |
+
label: "Name of organization (optional)",
|
138 |
+
required: true,
|
139 |
+
key: "organization",
|
140 |
+
},
|
141 |
+
{
|
142 |
+
label: "SDK (if type is space)",
|
143 |
+
key: "sdk",
|
144 |
+
},
|
145 |
+
{
|
146 |
+
label: "Whether the repo is private",
|
147 |
+
required: true,
|
148 |
+
key: "private",
|
149 |
+
defaultValue: false,
|
150 |
+
},
|
151 |
+
],
|
152 |
+
},
|
153 |
+
{
|
154 |
+
method: "DELETE",
|
155 |
+
path: "/api/repos/delete",
|
156 |
+
body: [
|
157 |
+
{
|
158 |
+
label: "Type of repo (dataset or space; model by default)",
|
159 |
+
key: "type",
|
160 |
+
required: true,
|
161 |
+
},
|
162 |
+
{
|
163 |
+
label: "Name of repo",
|
164 |
+
key: "name",
|
165 |
+
required: true,
|
166 |
+
},
|
167 |
+
{
|
168 |
+
label: "Name of organization (optional)",
|
169 |
+
required: true,
|
170 |
+
key: "organization",
|
171 |
+
},
|
172 |
+
],
|
173 |
+
},
|
174 |
+
{
|
175 |
+
method: "POST",
|
176 |
+
path: "/api/repos/move",
|
177 |
+
body: [
|
178 |
+
{
|
179 |
+
label: "From which repo",
|
180 |
+
key: "fromRepo",
|
181 |
+
required: true,
|
182 |
+
},
|
183 |
+
{
|
184 |
+
label: "To which repo",
|
185 |
+
key: "toRepo",
|
186 |
+
required: true,
|
187 |
+
},
|
188 |
+
],
|
189 |
+
},
|
190 |
+
],
|
191 |
+
},
|
192 |
+
{
|
193 |
+
key: "user",
|
194 |
+
endpoints: [
|
195 |
+
{
|
196 |
+
method: "GET",
|
197 |
+
path: "/api/whoami-v2",
|
198 |
+
},
|
199 |
+
],
|
200 |
+
},
|
201 |
+
{
|
202 |
+
key: "organizations",
|
203 |
+
endpoints: [
|
204 |
+
{
|
205 |
+
method: "GET",
|
206 |
+
path: "/api/organizations/{organization_name}/members",
|
207 |
+
},
|
208 |
+
],
|
209 |
+
},
|
210 |
+
{
|
211 |
+
key: "collection",
|
212 |
+
endpoints: [
|
213 |
+
{
|
214 |
+
method: "POST",
|
215 |
+
path: "/api/collections",
|
216 |
+
body: [
|
217 |
+
{
|
218 |
+
label: "Title of collection",
|
219 |
+
key: "title",
|
220 |
+
required: true,
|
221 |
+
},
|
222 |
+
{
|
223 |
+
label: "Namespace",
|
224 |
+
key: "namespace",
|
225 |
+
required: true,
|
226 |
+
},
|
227 |
+
{
|
228 |
+
label: "Description of collection",
|
229 |
+
key: "description",
|
230 |
+
required: true,
|
231 |
+
},
|
232 |
+
{
|
233 |
+
label: "Type",
|
234 |
+
key: "item.type",
|
235 |
+
required: true,
|
236 |
+
},
|
237 |
+
{
|
238 |
+
label: "RepoId/PaperId",
|
239 |
+
key: "item.id",
|
240 |
+
required: true,
|
241 |
+
},
|
242 |
+
{
|
243 |
+
label: "Whether the repo is private",
|
244 |
+
required: true,
|
245 |
+
key: "private",
|
246 |
+
defaultValue: false,
|
247 |
+
},
|
248 |
+
],
|
249 |
+
},
|
250 |
+
{
|
251 |
+
method: "GET",
|
252 |
+
path: "/api/collections",
|
253 |
+
parameters: {
|
254 |
+
owner: "",
|
255 |
+
sort: "",
|
256 |
+
item: "",
|
257 |
+
limit: 5,
|
258 |
+
q: "",
|
259 |
+
},
|
260 |
+
tooltips: {
|
261 |
+
item: 'filter collections containing a specific item. Value must be the item_type and item_id concatenated. Example: "models/teknium/OpenHermes-2.5-Mistral-7B", "datasets/squad" or "papers/2311.12983".',
|
262 |
+
q: "Filter based on substrings for titles & descriptions.",
|
263 |
+
},
|
264 |
+
},
|
265 |
+
{
|
266 |
+
method: "GET",
|
267 |
+
path: "/api/collections/{namespace}/{slug-id}",
|
268 |
+
},
|
269 |
+
{
|
270 |
+
method: "PATCH",
|
271 |
+
path: "/api/collections/{namespace}/{slug-id}",
|
272 |
+
body: [
|
273 |
+
{
|
274 |
+
label: "Title of collection",
|
275 |
+
key: "title",
|
276 |
+
required: true,
|
277 |
+
},
|
278 |
+
{
|
279 |
+
label: "Namespace",
|
280 |
+
key: "namespace",
|
281 |
+
required: true,
|
282 |
+
},
|
283 |
+
{
|
284 |
+
label: "Position",
|
285 |
+
required: true,
|
286 |
+
key: "position",
|
287 |
+
defaultValue: 0,
|
288 |
+
},
|
289 |
+
{
|
290 |
+
label: "Theme",
|
291 |
+
required: true,
|
292 |
+
key: "theme",
|
293 |
+
},
|
294 |
+
{
|
295 |
+
label: "Whether the repo is private",
|
296 |
+
required: true,
|
297 |
+
key: "private",
|
298 |
+
defaultValue: false,
|
299 |
+
},
|
300 |
+
],
|
301 |
+
},
|
302 |
+
{
|
303 |
+
method: "DELETE",
|
304 |
+
path: "/api/collections/{namespace}/{slug-id}",
|
305 |
+
},
|
306 |
+
{
|
307 |
+
method: "POST",
|
308 |
+
path: "/api/collections/{namespace}/{slug-id}/item",
|
309 |
+
body: [
|
310 |
+
{
|
311 |
+
label: "Type",
|
312 |
+
key: "item.type",
|
313 |
+
required: true,
|
314 |
+
},
|
315 |
+
{
|
316 |
+
label: "RepoId/PaperId",
|
317 |
+
key: "item.id",
|
318 |
+
required: true,
|
319 |
+
},
|
320 |
+
{
|
321 |
+
label: "Note",
|
322 |
+
key: "note",
|
323 |
+
required: true,
|
324 |
+
},
|
325 |
+
],
|
326 |
+
},
|
327 |
+
{
|
328 |
+
method: "PATCH",
|
329 |
+
path: "/api/collections/{namespace}/{slug-id}/item/{itemId}",
|
330 |
+
body: [
|
331 |
+
{
|
332 |
+
label: "Position",
|
333 |
+
key: "position",
|
334 |
+
defaultValue: 0,
|
335 |
+
required: true,
|
336 |
+
},
|
337 |
+
{
|
338 |
+
label: "Note",
|
339 |
+
key: "note",
|
340 |
+
required: true,
|
341 |
+
},
|
342 |
+
],
|
343 |
+
},
|
344 |
+
{
|
345 |
+
method: "DELETE",
|
346 |
+
path: "/api/collections/{namespace}/{slug-id}/item/{itemId}",
|
347 |
+
},
|
348 |
+
],
|
349 |
+
},
|
350 |
+
];
|