diff --git a/src/pages/llmodels/components/hf-model-file.tsx b/src/pages/llmodels/components/hf-model-file.tsx index b3d73e8a..850b71c5 100644 --- a/src/pages/llmodels/components/hf-model-file.tsx +++ b/src/pages/llmodels/components/hf-model-file.tsx @@ -44,7 +44,6 @@ interface HFModelFileProps { file: any, options: { requestModelId: number; manual?: boolean } ) => void; - updateEvaluteState: (state: 'model' | 'form' | 'file') => number; onSelectFileAfterEvaluate?: (file: any) => void; } @@ -55,13 +54,8 @@ const includeReg = /\.(safetensors|gguf)$/i; const filterRegGGUF = /\.(gguf)$/i; const HFModelFile: React.FC = forwardRef((props, ref) => { - const { - collapsed, - modelSource, - isDownload, - updateEvaluteState, - onSelectFileAfterEvaluate - } = props; + const { collapsed, modelSource, isDownload, onSelectFileAfterEvaluate } = + props; const intl = useIntl(); const [isEvaluating, setIsEvaluating] = useState(false); const [dataSource, setDataSource] = useState({ diff --git a/src/pages/llmodels/components/search-model.tsx b/src/pages/llmodels/components/search-model.tsx index ecc9ead6..22a59ca7 100644 --- a/src/pages/llmodels/components/search-model.tsx +++ b/src/pages/llmodels/components/search-model.tsx @@ -56,7 +56,7 @@ interface SearchInputProps { setLoadingModel?: (flag: boolean) => void; onSourceChange?: (source: string) => void; onSelectModel: (model: any, manul?: boolean) => void; - onSelectModelAfterEvaluate: (model: any, manual?: boolean) => void; + onSelectModelAfterEvaluate?: (model: any, manual?: boolean) => void; displayEvaluateStatus?: ( data: MessageStatus, options?: WarningStausOptions @@ -153,7 +153,7 @@ const SearchModel: React.FC = (props) => { if (!item.evaluated || item.isGGUF) { onSelectModel(item, manual); } else { - onSelectModelAfterEvaluate(item, manual); + onSelectModelAfterEvaluate?.(item, manual); } setCurrent(item.id); currentRef.current = item.id; @@ -338,7 +338,7 @@ const SearchModel: React.FC = (props) => { // if it is gguf, would trigger a evaluation after select a model file if (currentItem && !currentItem.isGGUF) { - onSelectModelAfterEvaluate(currentItem); + onSelectModelAfterEvaluate?.(currentItem); } } catch (error) { // cancel the corrponding request diff --git a/src/pages/llmodels/download/index.tsx b/src/pages/llmodels/download/index.tsx index b31266a0..9955a2bc 100644 --- a/src/pages/llmodels/download/index.tsx +++ b/src/pages/llmodels/download/index.tsx @@ -54,7 +54,7 @@ const DownloadModel: React.FC = (props) => { if (source === modelSourceMap.huggingface_value) { const huggingFaceModel = { huggingface_repo_id: selectedModel.name, - huggingface_filename: fileName + huggingface_filename: fileName || null }; return huggingFaceModel; } @@ -62,7 +62,7 @@ const DownloadModel: React.FC = (props) => { if (source === modelSourceMap.modelscope_value) { const modelScopeModel = { model_scope_model_id: selectedModel.name, - model_scope_file_path: fileName + model_scope_file_path: fileName || null }; return modelScopeModel; } diff --git a/src/pages/resources/components/add-worker.tsx b/src/pages/resources/components/add-worker.tsx index 4baae3c8..3f2769bd 100644 --- a/src/pages/resources/components/add-worker.tsx +++ b/src/pages/resources/components/add-worker.tsx @@ -1,10 +1,11 @@ +import ScrollerModal from '@/components/scroller-modal'; import { AppleOutlined, LinuxOutlined, WindowsOutlined } from '@ant-design/icons'; import { useIntl } from '@umijs/max'; -import { Modal, Tabs, TabsProps } from 'antd'; +import { Tabs, TabsProps } from 'antd'; import React from 'react'; import MacOS from './add-worker-macos'; import ContainerInstall from './container-install'; @@ -58,7 +59,7 @@ const AddWorker: React.FC = (props) => { ]; return ( - = (props) => { type="card" onChange={(key) => setActiveKey(key)} > - + ); }; -export default React.memo(AddWorker); +export default AddWorker;