chore: add model api

This commit is contained in:
jialin
2025-03-25 12:33:29 +08:00
parent 1819649a3a
commit 05ef2b8eaa
23 changed files with 774 additions and 186 deletions
+18
View File
@@ -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
};
+18 -4
View File
@@ -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;
}