chore: catalog card style

This commit is contained in:
jialin
2025-01-03 20:51:22 +08:00
parent d9319f5734
commit 1a792254ca
16 changed files with 696 additions and 299 deletions
+29 -5
View File
@@ -159,6 +159,30 @@ export const modelSourceValueMap = {
[modelSourceMap.local_path_value]: modelSourceMap.local_path
};
export const sourceOptions = [
{
label: 'Hugging Face',
value: modelSourceMap.huggingface_value,
key: 'huggingface'
},
{
label: 'Ollama Library',
value: modelSourceMap.ollama_library_value,
key: 'ollama_library'
},
{
label: 'ModelScope',
value: modelSourceMap.modelscope_value,
key: 'model_scope'
},
{
label: 'models.form.localPath',
locale: true,
value: modelSourceMap.local_path_value,
key: 'local_path'
}
];
export const InstanceStatusMap = {
Initializing: 'initializing',
Starting: 'starting',
@@ -255,11 +279,11 @@ export const modelCategoriesMap = {
export const modelCategories = [
{ label: 'common.options.auto', value: null, locale: true },
{ label: 'LLM', value: modelCategoriesMap.llm },
{ 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' }
{ label: 'Image', value: modelCategoriesMap.image },
{ label: 'Text-to-Speech', value: modelCategoriesMap.text_to_speech },
{ label: 'Speech-to-Text', value: modelCategoriesMap.speech_to_text },
{ label: 'Embedding', value: modelCategoriesMap.embedding },
{ label: 'Reranker', value: modelCategoriesMap.reranker }
];
export const sourceRepoConfig = {
+28
View File
@@ -133,3 +133,31 @@ export interface CatalogItem {
licenses: string[];
release_date: string;
}
export interface CatalogSpec {
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;
name: string;
description: string;
meta: Record<string, any>;
replicas: number;
ready_replicas: number;
categories: any[];
placement_strategy: string;
cpu_offloading: boolean;
distributed_inference_across_workers: boolean;
worker_selector: Record<string, any>;
gpu_selector: {
gpu_ids: string[];
};
backend: string;
backend_version: string;
backend_parameters: any[];
quantization: string;
size: number;
}