@mlhub/models-ts-sdk 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/apis/ModelsApi.d.ts +3 -10
- package/dist/apis/ModelsApi.js +5 -43
- package/dist/models/CreateModelMetadataBody.d.ts +1 -13
- package/dist/models/CreateModelMetadataBody.js +1 -5
- package/dist/models/ModelArtifact.d.ts +0 -13
- package/dist/models/ModelArtifact.js +0 -6
- package/dist/models/ModelMetadata.d.ts +3 -3
- package/dist/models/ModelMetadata.js +3 -3
- package/package.json +1 -1
- package/src/apis/ModelsApi.ts +7 -28
- package/src/models/CreateModelMetadataBody.ts +2 -18
- package/src/models/ModelArtifact.ts +0 -27
- package/src/models/ModelMetadata.ts +6 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @mlhub/models-ts-sdk@0.
|
|
1
|
+
## @mlhub/models-ts-sdk@0.4.0
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install @mlhub/models-ts-sdk@0.
|
|
39
|
+
npm install @mlhub/models-ts-sdk@0.4.0 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/dist/apis/ModelsApi.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface DiscoverModelsRequest {
|
|
|
19
19
|
limit?: number;
|
|
20
20
|
cursor?: string;
|
|
21
21
|
includeCount?: boolean;
|
|
22
|
+
includeGlobalModels?: boolean;
|
|
22
23
|
}
|
|
23
24
|
export interface GetModelByAuthorAndNameRequest {
|
|
24
25
|
name: string;
|
|
@@ -70,19 +71,11 @@ export declare class ModelsApi extends runtime.BaseAPI {
|
|
|
70
71
|
*/
|
|
71
72
|
ingestCanonicalModel(requestParameters: IngestCanonicalModelRequest, initOverrides?: RequestInit): Promise<IngestModelArtifactResponse>;
|
|
72
73
|
/**
|
|
73
|
-
* List
|
|
74
|
-
*/
|
|
75
|
-
listModelsRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListModelsResponse>>;
|
|
76
|
-
/**
|
|
77
|
-
* List all models
|
|
78
|
-
*/
|
|
79
|
-
listModels(initOverrides?: RequestInit): Promise<ListModelsResponse>;
|
|
80
|
-
/**
|
|
81
|
-
* List models by author
|
|
74
|
+
* List models by author in the current tenant
|
|
82
75
|
*/
|
|
83
76
|
listModelsByAuthorRaw(requestParameters: ListModelsByAuthorRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListModelsResponse>>;
|
|
84
77
|
/**
|
|
85
|
-
* List models by author
|
|
78
|
+
* List models by author in the current tenant
|
|
86
79
|
*/
|
|
87
80
|
listModelsByAuthor(requestParameters: ListModelsByAuthorRequest, initOverrides?: RequestInit): Promise<ListModelsResponse>;
|
|
88
81
|
}
|
package/dist/apis/ModelsApi.js
CHANGED
|
@@ -143,6 +143,9 @@ var ModelsApi = /** @class */ (function (_super) {
|
|
|
143
143
|
if (requestParameters.includeCount !== undefined) {
|
|
144
144
|
queryParameters['include_count'] = requestParameters.includeCount;
|
|
145
145
|
}
|
|
146
|
+
if (requestParameters.includeGlobalModels !== undefined) {
|
|
147
|
+
queryParameters['include_global_models'] = requestParameters.includeGlobalModels;
|
|
148
|
+
}
|
|
146
149
|
headerParameters = {};
|
|
147
150
|
headerParameters['Content-Type'] = 'application/json';
|
|
148
151
|
return [4 /*yield*/, this.request({
|
|
@@ -279,48 +282,7 @@ var ModelsApi = /** @class */ (function (_super) {
|
|
|
279
282
|
});
|
|
280
283
|
};
|
|
281
284
|
/**
|
|
282
|
-
* List
|
|
283
|
-
*/
|
|
284
|
-
ModelsApi.prototype.listModelsRaw = function (initOverrides) {
|
|
285
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
286
|
-
var queryParameters, headerParameters, response;
|
|
287
|
-
return __generator(this, function (_a) {
|
|
288
|
-
switch (_a.label) {
|
|
289
|
-
case 0:
|
|
290
|
-
queryParameters = {};
|
|
291
|
-
headerParameters = {};
|
|
292
|
-
return [4 /*yield*/, this.request({
|
|
293
|
-
path: "/models-api/models",
|
|
294
|
-
method: 'GET',
|
|
295
|
-
headers: headerParameters,
|
|
296
|
-
query: queryParameters,
|
|
297
|
-
}, initOverrides)];
|
|
298
|
-
case 1:
|
|
299
|
-
response = _a.sent();
|
|
300
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ListModelsResponseFromJSON)(jsonValue); })];
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
});
|
|
304
|
-
};
|
|
305
|
-
/**
|
|
306
|
-
* List all models
|
|
307
|
-
*/
|
|
308
|
-
ModelsApi.prototype.listModels = function (initOverrides) {
|
|
309
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
310
|
-
var response;
|
|
311
|
-
return __generator(this, function (_a) {
|
|
312
|
-
switch (_a.label) {
|
|
313
|
-
case 0: return [4 /*yield*/, this.listModelsRaw(initOverrides)];
|
|
314
|
-
case 1:
|
|
315
|
-
response = _a.sent();
|
|
316
|
-
return [4 /*yield*/, response.value()];
|
|
317
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
});
|
|
321
|
-
};
|
|
322
|
-
/**
|
|
323
|
-
* List models by author
|
|
285
|
+
* List models by author in the current tenant
|
|
324
286
|
*/
|
|
325
287
|
ModelsApi.prototype.listModelsByAuthorRaw = function (requestParameters, initOverrides) {
|
|
326
288
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -347,7 +309,7 @@ var ModelsApi = /** @class */ (function (_super) {
|
|
|
347
309
|
});
|
|
348
310
|
};
|
|
349
311
|
/**
|
|
350
|
-
* List models by author
|
|
312
|
+
* List models by author in the current tenant
|
|
351
313
|
*/
|
|
352
314
|
ModelsApi.prototype.listModelsByAuthor = function (requestParameters, initOverrides) {
|
|
353
315
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -22,12 +22,6 @@ export interface CreateModelMetadataBody {
|
|
|
22
22
|
* @memberof CreateModelMetadataBody
|
|
23
23
|
*/
|
|
24
24
|
annotations?: any | null;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @type {string}
|
|
28
|
-
* @memberof CreateModelMetadataBody
|
|
29
|
-
*/
|
|
30
|
-
author?: string | null;
|
|
31
25
|
/**
|
|
32
26
|
*
|
|
33
27
|
* @type {number}
|
|
@@ -153,7 +147,7 @@ export interface CreateModelMetadataBody {
|
|
|
153
147
|
* @type {string}
|
|
154
148
|
* @memberof CreateModelMetadataBody
|
|
155
149
|
*/
|
|
156
|
-
name
|
|
150
|
+
name: string;
|
|
157
151
|
/**
|
|
158
152
|
*
|
|
159
153
|
* @type {boolean}
|
|
@@ -203,12 +197,6 @@ export interface CreateModelMetadataBody {
|
|
|
203
197
|
* @memberof CreateModelMetadataBody
|
|
204
198
|
*/
|
|
205
199
|
task_types?: Array<Task> | null;
|
|
206
|
-
/**
|
|
207
|
-
*
|
|
208
|
-
* @type {string}
|
|
209
|
-
* @memberof CreateModelMetadataBody
|
|
210
|
-
*/
|
|
211
|
-
tenant_id?: string | null;
|
|
212
200
|
/**
|
|
213
201
|
*
|
|
214
202
|
* @type {boolean}
|
|
@@ -27,7 +27,6 @@ function CreateModelMetadataBodyFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
27
27
|
}
|
|
28
28
|
return {
|
|
29
29
|
'annotations': !(0, runtime_1.exists)(json, 'annotations') ? undefined : json['annotations'],
|
|
30
|
-
'author': !(0, runtime_1.exists)(json, 'author') ? undefined : json['author'],
|
|
31
30
|
'bias_evaluation_score': !(0, runtime_1.exists)(json, 'bias_evaluation_score') ? undefined : json['bias_evaluation_score'],
|
|
32
31
|
'edge_optimized': !(0, runtime_1.exists)(json, 'edge_optimized') ? undefined : json['edge_optimized'],
|
|
33
32
|
'finetuning_datasets': !(0, runtime_1.exists)(json, 'finetuning_datasets') ? undefined : json['finetuning_datasets'],
|
|
@@ -48,7 +47,7 @@ function CreateModelMetadataBodyFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
48
47
|
'model_outputs': !(0, runtime_1.exists)(json, 'model_outputs') ? undefined : (json['model_outputs'] === null ? null : json['model_outputs'].map(_1.ModelIOFromJSON)),
|
|
49
48
|
'model_type': !(0, runtime_1.exists)(json, 'model_type') ? undefined : json['model_type'],
|
|
50
49
|
'multi_modal': !(0, runtime_1.exists)(json, 'multi_modal') ? undefined : json['multi_modal'],
|
|
51
|
-
'name':
|
|
50
|
+
'name': json['name'],
|
|
52
51
|
'pretrained': !(0, runtime_1.exists)(json, 'pretrained') ? undefined : json['pretrained'],
|
|
53
52
|
'pretraining_datasets': !(0, runtime_1.exists)(json, 'pretraining_datasets') ? undefined : json['pretraining_datasets'],
|
|
54
53
|
'pruned': !(0, runtime_1.exists)(json, 'pruned') ? undefined : json['pruned'],
|
|
@@ -57,7 +56,6 @@ function CreateModelMetadataBodyFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
57
56
|
'slimmed': !(0, runtime_1.exists)(json, 'slimmed') ? undefined : json['slimmed'],
|
|
58
57
|
'supports_quantization': !(0, runtime_1.exists)(json, 'supports_quantization') ? undefined : json['supports_quantization'],
|
|
59
58
|
'task_types': !(0, runtime_1.exists)(json, 'task_types') ? undefined : (json['task_types'] === null ? null : json['task_types'].map(_1.TaskFromJSON)),
|
|
60
|
-
'tenant_id': !(0, runtime_1.exists)(json, 'tenant_id') ? undefined : json['tenant_id'],
|
|
61
59
|
'training_distributed': !(0, runtime_1.exists)(json, 'training_distributed') ? undefined : json['training_distributed'],
|
|
62
60
|
'training_hardware': !(0, runtime_1.exists)(json, 'training_hardware') ? undefined : (0, _1.HardwareRequirementsFromJSON)(json['training_hardware']),
|
|
63
61
|
'training_max_energy_consumption_watts': !(0, runtime_1.exists)(json, 'training_max_energy_consumption_watts') ? undefined : json['training_max_energy_consumption_watts'],
|
|
@@ -74,7 +72,6 @@ function CreateModelMetadataBodyToJSON(value) {
|
|
|
74
72
|
}
|
|
75
73
|
return {
|
|
76
74
|
'annotations': value.annotations,
|
|
77
|
-
'author': value.author,
|
|
78
75
|
'bias_evaluation_score': value.bias_evaluation_score,
|
|
79
76
|
'edge_optimized': value.edge_optimized,
|
|
80
77
|
'finetuning_datasets': value.finetuning_datasets,
|
|
@@ -104,7 +101,6 @@ function CreateModelMetadataBodyToJSON(value) {
|
|
|
104
101
|
'slimmed': value.slimmed,
|
|
105
102
|
'supports_quantization': value.supports_quantization,
|
|
106
103
|
'task_types': value.task_types === undefined ? undefined : (value.task_types === null ? null : value.task_types.map(_1.TaskToJSON)),
|
|
107
|
-
'tenant_id': value.tenant_id,
|
|
108
104
|
'training_distributed': value.training_distributed,
|
|
109
105
|
'training_hardware': (0, _1.HardwareRequirementsToJSON)(value.training_hardware),
|
|
110
106
|
'training_max_energy_consumption_watts': value.training_max_energy_consumption_watts,
|
|
@@ -9,19 +9,12 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import { ArtifactType, ModelMetadata } from './';
|
|
13
12
|
/**
|
|
14
13
|
*
|
|
15
14
|
* @export
|
|
16
15
|
* @interface ModelArtifact
|
|
17
16
|
*/
|
|
18
17
|
export interface ModelArtifact {
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @type {ArtifactType}
|
|
22
|
-
* @memberof ModelArtifact
|
|
23
|
-
*/
|
|
24
|
-
artifact_type: ArtifactType;
|
|
25
18
|
/**
|
|
26
19
|
*
|
|
27
20
|
* @type {string}
|
|
@@ -40,12 +33,6 @@ export interface ModelArtifact {
|
|
|
40
33
|
* @memberof ModelArtifact
|
|
41
34
|
*/
|
|
42
35
|
last_modified: string;
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @type {ModelMetadata}
|
|
46
|
-
* @memberof ModelArtifact
|
|
47
|
-
*/
|
|
48
|
-
metadata?: ModelMetadata;
|
|
49
36
|
}
|
|
50
37
|
export declare function ModelArtifactFromJSON(json: any): ModelArtifact;
|
|
51
38
|
export declare function ModelArtifactFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelArtifact;
|
|
@@ -16,8 +16,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.ModelArtifactFromJSON = ModelArtifactFromJSON;
|
|
17
17
|
exports.ModelArtifactFromJSONTyped = ModelArtifactFromJSONTyped;
|
|
18
18
|
exports.ModelArtifactToJSON = ModelArtifactToJSON;
|
|
19
|
-
var runtime_1 = require("../runtime");
|
|
20
|
-
var _1 = require("./");
|
|
21
19
|
function ModelArtifactFromJSON(json) {
|
|
22
20
|
return ModelArtifactFromJSONTyped(json, false);
|
|
23
21
|
}
|
|
@@ -26,11 +24,9 @@ function ModelArtifactFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
26
24
|
return json;
|
|
27
25
|
}
|
|
28
26
|
return {
|
|
29
|
-
'artifact_type': (0, _1.ArtifactTypeFromJSON)(json['artifact_type']),
|
|
30
27
|
'created_at': json['created_at'],
|
|
31
28
|
'id': json['id'],
|
|
32
29
|
'last_modified': json['last_modified'],
|
|
33
|
-
'metadata': !(0, runtime_1.exists)(json, 'metadata') ? undefined : (0, _1.ModelMetadataFromJSON)(json['metadata']),
|
|
34
30
|
};
|
|
35
31
|
}
|
|
36
32
|
function ModelArtifactToJSON(value) {
|
|
@@ -41,10 +37,8 @@ function ModelArtifactToJSON(value) {
|
|
|
41
37
|
return null;
|
|
42
38
|
}
|
|
43
39
|
return {
|
|
44
|
-
'artifact_type': (0, _1.ArtifactTypeToJSON)(value.artifact_type),
|
|
45
40
|
'created_at': value.created_at,
|
|
46
41
|
'id': value.id,
|
|
47
42
|
'last_modified': value.last_modified,
|
|
48
|
-
'metadata': (0, _1.ModelMetadataToJSON)(value.metadata),
|
|
49
43
|
};
|
|
50
44
|
}
|
|
@@ -27,7 +27,7 @@ export interface ModelMetadata {
|
|
|
27
27
|
* @type {string}
|
|
28
28
|
* @memberof ModelMetadata
|
|
29
29
|
*/
|
|
30
|
-
author
|
|
30
|
+
author: string;
|
|
31
31
|
/**
|
|
32
32
|
*
|
|
33
33
|
* @type {number}
|
|
@@ -159,7 +159,7 @@ export interface ModelMetadata {
|
|
|
159
159
|
* @type {string}
|
|
160
160
|
* @memberof ModelMetadata
|
|
161
161
|
*/
|
|
162
|
-
name
|
|
162
|
+
name: string;
|
|
163
163
|
/**
|
|
164
164
|
*
|
|
165
165
|
* @type {boolean}
|
|
@@ -214,7 +214,7 @@ export interface ModelMetadata {
|
|
|
214
214
|
* @type {string}
|
|
215
215
|
* @memberof ModelMetadata
|
|
216
216
|
*/
|
|
217
|
-
tenant_id
|
|
217
|
+
tenant_id: string;
|
|
218
218
|
/**
|
|
219
219
|
*
|
|
220
220
|
* @type {boolean}
|
|
@@ -27,7 +27,7 @@ function ModelMetadataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
27
27
|
}
|
|
28
28
|
return {
|
|
29
29
|
'annotations': !(0, runtime_1.exists)(json, 'annotations') ? undefined : json['annotations'],
|
|
30
|
-
'author':
|
|
30
|
+
'author': json['author'],
|
|
31
31
|
'bias_evaluation_score': !(0, runtime_1.exists)(json, 'bias_evaluation_score') ? undefined : json['bias_evaluation_score'],
|
|
32
32
|
'canonical': !(0, runtime_1.exists)(json, 'canonical') ? undefined : (0, _1.CanonicalFromJSON)(json['canonical']),
|
|
33
33
|
'edge_optimized': !(0, runtime_1.exists)(json, 'edge_optimized') ? undefined : json['edge_optimized'],
|
|
@@ -49,7 +49,7 @@ function ModelMetadataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
49
49
|
'model_outputs': !(0, runtime_1.exists)(json, 'model_outputs') ? undefined : (json['model_outputs'] === null ? null : json['model_outputs'].map(_1.ModelIOFromJSON)),
|
|
50
50
|
'model_type': !(0, runtime_1.exists)(json, 'model_type') ? undefined : json['model_type'],
|
|
51
51
|
'multi_modal': !(0, runtime_1.exists)(json, 'multi_modal') ? undefined : json['multi_modal'],
|
|
52
|
-
'name':
|
|
52
|
+
'name': json['name'],
|
|
53
53
|
'pretrained': !(0, runtime_1.exists)(json, 'pretrained') ? undefined : json['pretrained'],
|
|
54
54
|
'pretraining_datasets': !(0, runtime_1.exists)(json, 'pretraining_datasets') ? undefined : json['pretraining_datasets'],
|
|
55
55
|
'pruned': !(0, runtime_1.exists)(json, 'pruned') ? undefined : json['pruned'],
|
|
@@ -58,7 +58,7 @@ function ModelMetadataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
58
58
|
'slimmed': !(0, runtime_1.exists)(json, 'slimmed') ? undefined : json['slimmed'],
|
|
59
59
|
'supports_quantization': !(0, runtime_1.exists)(json, 'supports_quantization') ? undefined : json['supports_quantization'],
|
|
60
60
|
'task_types': !(0, runtime_1.exists)(json, 'task_types') ? undefined : (json['task_types'] === null ? null : json['task_types'].map(_1.TaskFromJSON)),
|
|
61
|
-
'tenant_id':
|
|
61
|
+
'tenant_id': json['tenant_id'],
|
|
62
62
|
'training_distributed': !(0, runtime_1.exists)(json, 'training_distributed') ? undefined : json['training_distributed'],
|
|
63
63
|
'training_hardware': !(0, runtime_1.exists)(json, 'training_hardware') ? undefined : (0, _1.HardwareRequirementsFromJSON)(json['training_hardware']),
|
|
64
64
|
'training_max_energy_consumption_watts': !(0, runtime_1.exists)(json, 'training_max_energy_consumption_watts') ? undefined : json['training_max_energy_consumption_watts'],
|
package/package.json
CHANGED
package/src/apis/ModelsApi.ts
CHANGED
|
@@ -59,6 +59,7 @@ export interface DiscoverModelsRequest {
|
|
|
59
59
|
limit?: number;
|
|
60
60
|
cursor?: string;
|
|
61
61
|
includeCount?: boolean;
|
|
62
|
+
includeGlobalModels?: boolean;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
export interface GetModelByAuthorAndNameRequest {
|
|
@@ -137,6 +138,10 @@ export class ModelsApi extends runtime.BaseAPI {
|
|
|
137
138
|
queryParameters['include_count'] = requestParameters.includeCount;
|
|
138
139
|
}
|
|
139
140
|
|
|
141
|
+
if (requestParameters.includeGlobalModels !== undefined) {
|
|
142
|
+
queryParameters['include_global_models'] = requestParameters.includeGlobalModels;
|
|
143
|
+
}
|
|
144
|
+
|
|
140
145
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
141
146
|
|
|
142
147
|
headerParameters['Content-Type'] = 'application/json';
|
|
@@ -240,33 +245,7 @@ export class ModelsApi extends runtime.BaseAPI {
|
|
|
240
245
|
}
|
|
241
246
|
|
|
242
247
|
/**
|
|
243
|
-
* List
|
|
244
|
-
*/
|
|
245
|
-
async listModelsRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListModelsResponse>> {
|
|
246
|
-
const queryParameters: any = {};
|
|
247
|
-
|
|
248
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
249
|
-
|
|
250
|
-
const response = await this.request({
|
|
251
|
-
path: `/models-api/models`,
|
|
252
|
-
method: 'GET',
|
|
253
|
-
headers: headerParameters,
|
|
254
|
-
query: queryParameters,
|
|
255
|
-
}, initOverrides);
|
|
256
|
-
|
|
257
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => ListModelsResponseFromJSON(jsonValue));
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* List all models
|
|
262
|
-
*/
|
|
263
|
-
async listModels(initOverrides?: RequestInit): Promise<ListModelsResponse> {
|
|
264
|
-
const response = await this.listModelsRaw(initOverrides);
|
|
265
|
-
return await response.value();
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* List models by author
|
|
248
|
+
* List models by author in the current tenant
|
|
270
249
|
*/
|
|
271
250
|
async listModelsByAuthorRaw(requestParameters: ListModelsByAuthorRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListModelsResponse>> {
|
|
272
251
|
if (requestParameters.author === null || requestParameters.author === undefined) {
|
|
@@ -288,7 +267,7 @@ export class ModelsApi extends runtime.BaseAPI {
|
|
|
288
267
|
}
|
|
289
268
|
|
|
290
269
|
/**
|
|
291
|
-
* List models by author
|
|
270
|
+
* List models by author in the current tenant
|
|
292
271
|
*/
|
|
293
272
|
async listModelsByAuthor(requestParameters: ListModelsByAuthorRequest, initOverrides?: RequestInit): Promise<ListModelsResponse> {
|
|
294
273
|
const response = await this.listModelsByAuthorRaw(requestParameters, initOverrides);
|
|
@@ -40,12 +40,6 @@ export interface CreateModelMetadataBody {
|
|
|
40
40
|
* @memberof CreateModelMetadataBody
|
|
41
41
|
*/
|
|
42
42
|
annotations?: any | null;
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @type {string}
|
|
46
|
-
* @memberof CreateModelMetadataBody
|
|
47
|
-
*/
|
|
48
|
-
author?: string | null;
|
|
49
43
|
/**
|
|
50
44
|
*
|
|
51
45
|
* @type {number}
|
|
@@ -171,7 +165,7 @@ export interface CreateModelMetadataBody {
|
|
|
171
165
|
* @type {string}
|
|
172
166
|
* @memberof CreateModelMetadataBody
|
|
173
167
|
*/
|
|
174
|
-
name
|
|
168
|
+
name: string;
|
|
175
169
|
/**
|
|
176
170
|
*
|
|
177
171
|
* @type {boolean}
|
|
@@ -221,12 +215,6 @@ export interface CreateModelMetadataBody {
|
|
|
221
215
|
* @memberof CreateModelMetadataBody
|
|
222
216
|
*/
|
|
223
217
|
task_types?: Array<Task> | null;
|
|
224
|
-
/**
|
|
225
|
-
*
|
|
226
|
-
* @type {string}
|
|
227
|
-
* @memberof CreateModelMetadataBody
|
|
228
|
-
*/
|
|
229
|
-
tenant_id?: string | null;
|
|
230
218
|
/**
|
|
231
219
|
*
|
|
232
220
|
* @type {boolean}
|
|
@@ -270,7 +258,6 @@ export function CreateModelMetadataBodyFromJSONTyped(json: any, ignoreDiscrimina
|
|
|
270
258
|
return {
|
|
271
259
|
|
|
272
260
|
'annotations': !exists(json, 'annotations') ? undefined : json['annotations'],
|
|
273
|
-
'author': !exists(json, 'author') ? undefined : json['author'],
|
|
274
261
|
'bias_evaluation_score': !exists(json, 'bias_evaluation_score') ? undefined : json['bias_evaluation_score'],
|
|
275
262
|
'edge_optimized': !exists(json, 'edge_optimized') ? undefined : json['edge_optimized'],
|
|
276
263
|
'finetuning_datasets': !exists(json, 'finetuning_datasets') ? undefined : json['finetuning_datasets'],
|
|
@@ -291,7 +278,7 @@ export function CreateModelMetadataBodyFromJSONTyped(json: any, ignoreDiscrimina
|
|
|
291
278
|
'model_outputs': !exists(json, 'model_outputs') ? undefined : (json['model_outputs'] === null ? null : (json['model_outputs'] as Array<any>).map(ModelIOFromJSON)),
|
|
292
279
|
'model_type': !exists(json, 'model_type') ? undefined : json['model_type'],
|
|
293
280
|
'multi_modal': !exists(json, 'multi_modal') ? undefined : json['multi_modal'],
|
|
294
|
-
'name':
|
|
281
|
+
'name': json['name'],
|
|
295
282
|
'pretrained': !exists(json, 'pretrained') ? undefined : json['pretrained'],
|
|
296
283
|
'pretraining_datasets': !exists(json, 'pretraining_datasets') ? undefined : json['pretraining_datasets'],
|
|
297
284
|
'pruned': !exists(json, 'pruned') ? undefined : json['pruned'],
|
|
@@ -300,7 +287,6 @@ export function CreateModelMetadataBodyFromJSONTyped(json: any, ignoreDiscrimina
|
|
|
300
287
|
'slimmed': !exists(json, 'slimmed') ? undefined : json['slimmed'],
|
|
301
288
|
'supports_quantization': !exists(json, 'supports_quantization') ? undefined : json['supports_quantization'],
|
|
302
289
|
'task_types': !exists(json, 'task_types') ? undefined : (json['task_types'] === null ? null : (json['task_types'] as Array<any>).map(TaskFromJSON)),
|
|
303
|
-
'tenant_id': !exists(json, 'tenant_id') ? undefined : json['tenant_id'],
|
|
304
290
|
'training_distributed': !exists(json, 'training_distributed') ? undefined : json['training_distributed'],
|
|
305
291
|
'training_hardware': !exists(json, 'training_hardware') ? undefined : HardwareRequirementsFromJSON(json['training_hardware']),
|
|
306
292
|
'training_max_energy_consumption_watts': !exists(json, 'training_max_energy_consumption_watts') ? undefined : json['training_max_energy_consumption_watts'],
|
|
@@ -319,7 +305,6 @@ export function CreateModelMetadataBodyToJSON(value?: CreateModelMetadataBody |
|
|
|
319
305
|
return {
|
|
320
306
|
|
|
321
307
|
'annotations': value.annotations,
|
|
322
|
-
'author': value.author,
|
|
323
308
|
'bias_evaluation_score': value.bias_evaluation_score,
|
|
324
309
|
'edge_optimized': value.edge_optimized,
|
|
325
310
|
'finetuning_datasets': value.finetuning_datasets,
|
|
@@ -349,7 +334,6 @@ export function CreateModelMetadataBodyToJSON(value?: CreateModelMetadataBody |
|
|
|
349
334
|
'slimmed': value.slimmed,
|
|
350
335
|
'supports_quantization': value.supports_quantization,
|
|
351
336
|
'task_types': value.task_types === undefined ? undefined : (value.task_types === null ? null : (value.task_types as Array<any>).map(TaskToJSON)),
|
|
352
|
-
'tenant_id': value.tenant_id,
|
|
353
337
|
'training_distributed': value.training_distributed,
|
|
354
338
|
'training_hardware': HardwareRequirementsToJSON(value.training_hardware),
|
|
355
339
|
'training_max_energy_consumption_watts': value.training_max_energy_consumption_watts,
|
|
@@ -13,29 +13,12 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { exists, mapValues } from '../runtime';
|
|
16
|
-
import {
|
|
17
|
-
ArtifactType,
|
|
18
|
-
ArtifactTypeFromJSON,
|
|
19
|
-
ArtifactTypeFromJSONTyped,
|
|
20
|
-
ArtifactTypeToJSON,
|
|
21
|
-
ModelMetadata,
|
|
22
|
-
ModelMetadataFromJSON,
|
|
23
|
-
ModelMetadataFromJSONTyped,
|
|
24
|
-
ModelMetadataToJSON,
|
|
25
|
-
} from './';
|
|
26
|
-
|
|
27
16
|
/**
|
|
28
17
|
*
|
|
29
18
|
* @export
|
|
30
19
|
* @interface ModelArtifact
|
|
31
20
|
*/
|
|
32
21
|
export interface ModelArtifact {
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @type {ArtifactType}
|
|
36
|
-
* @memberof ModelArtifact
|
|
37
|
-
*/
|
|
38
|
-
artifact_type: ArtifactType;
|
|
39
22
|
/**
|
|
40
23
|
*
|
|
41
24
|
* @type {string}
|
|
@@ -54,12 +37,6 @@ export interface ModelArtifact {
|
|
|
54
37
|
* @memberof ModelArtifact
|
|
55
38
|
*/
|
|
56
39
|
last_modified: string;
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
* @type {ModelMetadata}
|
|
60
|
-
* @memberof ModelArtifact
|
|
61
|
-
*/
|
|
62
|
-
metadata?: ModelMetadata;
|
|
63
40
|
}
|
|
64
41
|
|
|
65
42
|
export function ModelArtifactFromJSON(json: any): ModelArtifact {
|
|
@@ -72,11 +49,9 @@ export function ModelArtifactFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
72
49
|
}
|
|
73
50
|
return {
|
|
74
51
|
|
|
75
|
-
'artifact_type': ArtifactTypeFromJSON(json['artifact_type']),
|
|
76
52
|
'created_at': json['created_at'],
|
|
77
53
|
'id': json['id'],
|
|
78
54
|
'last_modified': json['last_modified'],
|
|
79
|
-
'metadata': !exists(json, 'metadata') ? undefined : ModelMetadataFromJSON(json['metadata']),
|
|
80
55
|
};
|
|
81
56
|
}
|
|
82
57
|
|
|
@@ -89,11 +64,9 @@ export function ModelArtifactToJSON(value?: ModelArtifact | null): any {
|
|
|
89
64
|
}
|
|
90
65
|
return {
|
|
91
66
|
|
|
92
|
-
'artifact_type': ArtifactTypeToJSON(value.artifact_type),
|
|
93
67
|
'created_at': value.created_at,
|
|
94
68
|
'id': value.id,
|
|
95
69
|
'last_modified': value.last_modified,
|
|
96
|
-
'metadata': ModelMetadataToJSON(value.metadata),
|
|
97
70
|
};
|
|
98
71
|
}
|
|
99
72
|
|
|
@@ -49,7 +49,7 @@ export interface ModelMetadata {
|
|
|
49
49
|
* @type {string}
|
|
50
50
|
* @memberof ModelMetadata
|
|
51
51
|
*/
|
|
52
|
-
author
|
|
52
|
+
author: string;
|
|
53
53
|
/**
|
|
54
54
|
*
|
|
55
55
|
* @type {number}
|
|
@@ -181,7 +181,7 @@ export interface ModelMetadata {
|
|
|
181
181
|
* @type {string}
|
|
182
182
|
* @memberof ModelMetadata
|
|
183
183
|
*/
|
|
184
|
-
name
|
|
184
|
+
name: string;
|
|
185
185
|
/**
|
|
186
186
|
*
|
|
187
187
|
* @type {boolean}
|
|
@@ -236,7 +236,7 @@ export interface ModelMetadata {
|
|
|
236
236
|
* @type {string}
|
|
237
237
|
* @memberof ModelMetadata
|
|
238
238
|
*/
|
|
239
|
-
tenant_id
|
|
239
|
+
tenant_id: string;
|
|
240
240
|
/**
|
|
241
241
|
*
|
|
242
242
|
* @type {boolean}
|
|
@@ -280,7 +280,7 @@ export function ModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
280
280
|
return {
|
|
281
281
|
|
|
282
282
|
'annotations': !exists(json, 'annotations') ? undefined : json['annotations'],
|
|
283
|
-
'author':
|
|
283
|
+
'author': json['author'],
|
|
284
284
|
'bias_evaluation_score': !exists(json, 'bias_evaluation_score') ? undefined : json['bias_evaluation_score'],
|
|
285
285
|
'canonical': !exists(json, 'canonical') ? undefined : CanonicalFromJSON(json['canonical']),
|
|
286
286
|
'edge_optimized': !exists(json, 'edge_optimized') ? undefined : json['edge_optimized'],
|
|
@@ -302,7 +302,7 @@ export function ModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
302
302
|
'model_outputs': !exists(json, 'model_outputs') ? undefined : (json['model_outputs'] === null ? null : (json['model_outputs'] as Array<any>).map(ModelIOFromJSON)),
|
|
303
303
|
'model_type': !exists(json, 'model_type') ? undefined : json['model_type'],
|
|
304
304
|
'multi_modal': !exists(json, 'multi_modal') ? undefined : json['multi_modal'],
|
|
305
|
-
'name':
|
|
305
|
+
'name': json['name'],
|
|
306
306
|
'pretrained': !exists(json, 'pretrained') ? undefined : json['pretrained'],
|
|
307
307
|
'pretraining_datasets': !exists(json, 'pretraining_datasets') ? undefined : json['pretraining_datasets'],
|
|
308
308
|
'pruned': !exists(json, 'pruned') ? undefined : json['pruned'],
|
|
@@ -311,7 +311,7 @@ export function ModelMetadataFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
311
311
|
'slimmed': !exists(json, 'slimmed') ? undefined : json['slimmed'],
|
|
312
312
|
'supports_quantization': !exists(json, 'supports_quantization') ? undefined : json['supports_quantization'],
|
|
313
313
|
'task_types': !exists(json, 'task_types') ? undefined : (json['task_types'] === null ? null : (json['task_types'] as Array<any>).map(TaskFromJSON)),
|
|
314
|
-
'tenant_id':
|
|
314
|
+
'tenant_id': json['tenant_id'],
|
|
315
315
|
'training_distributed': !exists(json, 'training_distributed') ? undefined : json['training_distributed'],
|
|
316
316
|
'training_hardware': !exists(json, 'training_hardware') ? undefined : HardwareRequirementsFromJSON(json['training_hardware']),
|
|
317
317
|
'training_max_energy_consumption_watts': !exists(json, 'training_max_energy_consumption_watts') ? undefined : json['training_max_energy_consumption_watts'],
|