-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathmodel.ts
57 lines (52 loc) · 1.29 KB
/
model.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
// TODO: rename the enum keys accordingly
export enum MODEL_STATE {
loaded = 'DEPLOYED',
trained = 'TRAINED',
unloaded = 'UNDEPLOYED',
uploaded = 'REGISTERED',
uploading = 'REGISTERING',
loading = 'DEPLOYING',
partiallyLoaded = 'PARTIALLY_DEPLOYED',
loadFailed = 'DEPLOY_FAILED',
}
export interface OpenSearchModelBase {
name: string;
model_id: string;
model_state: MODEL_STATE;
model_version: string;
}
export interface OpenSearchSelfTrainedModel extends OpenSearchModelBase {
algorithm: string;
}
export interface OpenSearchCustomerModel extends OpenSearchModelBase {
chunk_number: number;
created_time: number;
description: string;
last_loaded_time?: number;
last_unloaded_time?: number;
last_uploaded_time: number;
model_config: {
all_config?: string;
embedding_dimension: number;
framework_type: string;
model_type: string;
};
model_content: string;
model_content_hash_value: string;
model_content_size_in_bytes: string;
model_format: string;
total_chunks: number;
version: number;
planning_worker_nodes: string[];
}
export type ModelSearchSort =
| 'name-asc'
| 'name-desc'
| 'id-asc'
| 'model_state-asc'
| 'model_state-desc'
| 'id-desc';