chore: add model api
This commit is contained in:
@@ -114,3 +114,21 @@ export const containerInstallOptions = [
|
||||
{ label: 'Hygon DCU', value: 'dcu' },
|
||||
{ label: 'CPU', value: 'cpu' }
|
||||
];
|
||||
|
||||
export const ModelfileStateMap = {
|
||||
Error: 'error',
|
||||
Downloading: 'downloading',
|
||||
Ready: 'ready'
|
||||
};
|
||||
|
||||
export const ModelfileStateMapValue = {
|
||||
[ModelfileStateMap.Error]: 'Error',
|
||||
[ModelfileStateMap.Downloading]: 'Downloading',
|
||||
[ModelfileStateMap.Ready]: 'Ready'
|
||||
};
|
||||
|
||||
export const ModelfileState: any = {
|
||||
[ModelfileStateMap.Ready]: StatusMaps.success,
|
||||
[ModelfileStateMap.Error]: StatusMaps.error,
|
||||
[ModelfileStateMap.Downloading]: StatusMaps.transitioning
|
||||
};
|
||||
|
||||
@@ -99,17 +99,31 @@ export interface ListItem {
|
||||
|
||||
export interface ModelFile {
|
||||
source: string;
|
||||
size: number;
|
||||
id: number;
|
||||
created_at: string;
|
||||
worker_name: string;
|
||||
huggingface_repo_id: string;
|
||||
huggingface_filename: string;
|
||||
ollama_library_model_name: string;
|
||||
model_scope_model_id: string;
|
||||
model_scope_file_path: string;
|
||||
local_path: string;
|
||||
local_dir: string;
|
||||
worker_id: number;
|
||||
size: number;
|
||||
download_progress: number;
|
||||
resolved_paths: string[];
|
||||
state: string;
|
||||
state_message: string;
|
||||
id: number;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface ModelFileFormData {
|
||||
source: string;
|
||||
huggingface_repo_id: string;
|
||||
huggingface_filename: string;
|
||||
ollama_library_model_name: string;
|
||||
model_scope_model_id: string;
|
||||
model_scope_file_path: string;
|
||||
local_path: string;
|
||||
local_dir: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user