diff --git a/src/pages/llmodels/components/deploy-modal.tsx b/src/pages/llmodels/components/deploy-modal.tsx index 18caddf3..84f3faf2 100644 --- a/src/pages/llmodels/components/deploy-modal.tsx +++ b/src/pages/llmodels/components/deploy-modal.tsx @@ -13,7 +13,11 @@ import { } from '../config'; import { FormContext } from '../config/form-context'; import { FormData, SourceType } from '../config/types'; -import { useCheckCompatibility, useSelectModel } from '../hooks'; +import { + checkOnlyAscendNPU, + useCheckCompatibility, + useSelectModel +} from '../hooks'; import ColumnWrapper from './column-wrapper'; import CompatibilityAlert from './compatible-alert'; import DataForm from './data-form'; @@ -219,10 +223,13 @@ const AddModal: FC = (props) => { source: source }); } else { - const backend = - source === modelSourceMap.ollama_library_value - ? backendOptionsMap.llamaBox - : backendOptionsMap.vllm; + let backend = checkOnlyAscendNPU(props.gpuOptions) + ? backendOptionsMap.ascendMindie + : backendOptionsMap.vllm; + + if (source === modelSourceMap.ollama_library_value) { + backend = backendOptionsMap.llamaBox; + } form.current?.setFieldValue?.('backend', backend); setIsGGUF(source === modelSourceMap.ollama_library_value); } @@ -233,7 +240,6 @@ const AddModal: FC = (props) => { }, [warningStatus.show, warningStatus.type]); const displayEvaluateStatus = () => { - console.log('displayEvaluateStatus==='); setWarningStatus({ show: true, title: '', @@ -256,7 +262,7 @@ const AddModal: FC = (props) => { message: [] }); }; - }, [open]); + }, [open, props.gpuOptions.length]); return ( { worker_id: value }); }; - const generateInitialValues = (record: ListItem) => { + const generateInitialValues = (record: ListItem, gpuOptions: any[]) => { const isGGUF = _.includes(record.resolved_paths?.[0], 'gguf'); const isOllama = !!record.ollama_library_model_name; const audioModelTag = identifyModelTask( @@ -403,12 +404,12 @@ const ModelFiles = () => { } : {}, name: extractFileName(name), - backend: - isGGUF || isOllama - ? backendOptionsMap.llamaBox - : audioModelTag - ? backendOptionsMap.voxBox - : backendOptionsMap.vllm, + backend: checkCurrentbackend({ + isGGUF: !audioModelTag && (isGGUF || isOllama), + isAudio: !!audioModelTag, + gpuOptions: gpuOptions, + defaultBackend: backendOptionsMap.vllm + }), isGGUF: !audioModelTag && (isGGUF || isOllama) }; }; @@ -438,7 +439,7 @@ const ModelFiles = () => { getGPUList() ]); const dataList = generateModelFileOptions(modelFileList, workersList); - const initialValues = generateInitialValues(record); + const initialValues = generateInitialValues(record, gpuList); setOpenDeployModal({ ...openDeployModal, modelFileOptions: dataList,