feat: model category

This commit is contained in:
jialin
2024-12-27 19:12:51 +08:00
parent 9f40e2c71e
commit b4e30565d2
16 changed files with 68 additions and 56 deletions
+17
View File
@@ -240,6 +240,23 @@ export const placementStrategyOptions = [
}
];
export const modelCategoriesMap = {
image: 'image',
text_to_speech: 'text_to_speech',
speech_to_text: 'speech_to_text',
embedding: 'embedding',
reranker: 'reranker'
};
export const modelCategories = [
{ label: 'common.options.auto', value: null, locale: true },
{ label: 'Image', value: 'image' },
{ label: 'Text-to-speech', value: 'text_to_speech' },
{ label: 'Speech-to-text', value: 'speech_to_text' },
{ label: 'Embedding', value: 'embedding' },
{ label: 'Reranker', value: 'reranker' }
];
export const sourceRepoConfig = {
[modelSourceMap.huggingface_value]: {
repo_id: 'huggingface_repo_id',
+4 -6
View File
@@ -1,6 +1,7 @@
export interface ListItem {
source: string;
backend: string;
categories?: string[];
reranker: boolean;
image_only?: boolean;
huggingface_repo_id: string;
@@ -23,15 +24,14 @@ export interface ListItem {
created_at: string;
updated_at: string;
gpu_selector?: {
worker_name: string;
gpu_index: number;
gpu_name: string;
gpu_ids: string[];
};
worker_selector?: object;
}
export interface FormData {
backend?: string;
categories?: string;
backend_parameters?: string[];
backend_version?: string;
source: string;
@@ -46,9 +46,7 @@ export interface FormData {
model_scope_model_id?: string;
model_scope_file_path?: string;
gpu_selector?: {
worker_name: string;
gpu_index: number;
gpu_name: string;
gpu_ids: string[];
};
placement_strategy?: string;
cpu_offloading?: boolean;