enzostvs HF Staff commited on
Commit
68bd956
·
1 Parent(s): c21a86e
Files changed (1) hide show
  1. 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
- key: 'search',
5
- endpoints: [
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
- label: "Type of repo (dataset or space; model by default)",
108
- key: "type",
109
- required: true,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  },
111
  {
112
- label: "Name of repo",
113
- key: "name",
114
- required: true,
115
  },
116
  {
117
- label: "Name of organization (optional)",
118
- required: true,
119
- key: "organization",
120
  },
121
  {
122
- label: "SDK (if type is space)",
123
- key: "sdk",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  },
125
  {
126
- label: "Whether the repo is private",
127
- required: true,
128
- key: "private",
129
- defaultValue: false,
 
 
 
 
130
  },
131
- ]
132
- }, {
133
- method: 'DELETE',
134
- path: '/api/repos/delete',
135
- body: [{
136
- label: "Type of repo (dataset or space; model by default)",
137
- key: "type",
138
- required: true,
139
- },
140
- {
141
- label: "Name of repo",
142
- key: "name",
143
- required: true,
144
- },
145
- {
146
- label: "Name of organization (optional)",
147
- required: true,
148
- key: "organization",
149
- }]
150
- }, {
151
- method: 'POST',
152
- path: '/api/repos/move',
153
- body: [{
154
- label: "From which repo",
155
- key: "fromRepo",
156
- required: true,
157
- },
158
- {
159
- label: "To which repo",
160
- key: "toRepo",
161
- required: true,
162
- }]
163
- }],
164
- },
165
- {
166
- key: 'user',
167
- endpoints: [{
168
- method: 'GET',
169
- path: '/api/whoami-v2',
170
- }],
171
- },
172
- {
173
- key: 'organizations',
174
- endpoints: [{
175
- method: 'GET',
176
- path: '/api/organizations/{organization_name}/members'
177
- }],
178
- },
179
- {
180
- key: 'collection',
181
- endpoints: [{
182
- method: 'POST',
183
- path: '/api/collections',
184
- body: [{
185
- label: "Title of collection",
186
- key: "title",
187
- required: true,
188
- }, {
189
- label: "Namespace",
190
- key: "namespace",
191
- required: true,
192
- }, {
193
- label: "Description of collection",
194
- key: "description",
195
- required: true,
196
- }, {
197
- label: "Type",
198
- key: "item.type",
199
- required: true,
200
- }, {
201
- label: "RepoId/PaperId",
202
- key: "item.id",
203
- required: true,
204
- }, {
205
- label: "Whether the repo is private",
206
- required: true,
207
- key: "private",
208
- defaultValue: false,
209
- }]
210
- }, {
211
- method: "GET",
212
- path: '/api/collections',
213
- parameters: {
214
- owner: "",
215
- sort: "",
216
- item: "",
217
- limit: 5,
218
- q: ""
219
- },
220
- tooltips: {
221
- 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\".",
222
- q: "Filter based on substrings for titles & descriptions."
223
- }
224
- }, {
225
- method: 'GET',
226
- path: '/api/collections/{namespace}/{slug-id}',
227
- },{
228
- method: 'PATCH',
229
- path: '/api/collections/{namespace}/{slug-id}',
230
- body: [{
231
- label: "Title of collection",
232
- key: "title",
233
- required: true,
234
- }, {
235
- label: "Namespace",
236
- key: "namespace",
237
- required: true,
238
- }, {
239
- label: "Position",
240
- required: true,
241
- key: "position",
242
- defaultValue: 0,
243
- }, {
244
- label: "Theme",
245
- required: true,
246
- key: "theme",
247
- }, {
248
- label: "Whether the repo is private",
249
- required: true,
250
- key: "private",
251
- defaultValue: false,
252
- }]
253
- }, {
254
- method: 'DELETE',
255
- path: '/api/collections/{namespace}/{slug-id}',
256
- }, {
257
- method: 'POST',
258
- path: '/api/collections/{namespace}/{slug-id}/item',
259
- body: [{
260
- label: "Type",
261
- key: "item.type",
262
- required: true,
263
- }, {
264
- label: "RepoId/PaperId",
265
- key: "item.id",
266
- required: true,
267
- }, {
268
- label: "Note",
269
- key: "note",
270
- required: true,
271
- }]
272
- }, {
273
- method: 'PATCH',
274
- path: '/api/collections/{namespace}/{slug-id}/item/{itemId}',
275
- body: [{
276
- label: "Position",
277
- key: "position",
278
- defaultValue: 0,
279
- required: true,
280
- }, {
281
- label: "Note",
282
- key: "note",
283
- required: true,
284
- }]
285
- }, {
286
- method: 'DELETE',
287
- path: '/api/collections/{namespace}/{slug-id}/item/{itemId}',
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
+ ];