diff --git a/src/locales/en-US/models.ts b/src/locales/en-US/models.ts index 88a9a3f2..8a0521fe 100644 --- a/src/locales/en-US/models.ts +++ b/src/locales/en-US/models.ts @@ -103,5 +103,8 @@ export default { 'Specify the model directory that contains .safetensors and config.json files, e.g., /usr/local/models/model/.', 'models.localpath.chunks.tips': `Specify the first shard file of the model, e.g., /usr/local/models/model-00001-of-00004.gguf.`, 'models.form.replicas.tips': - 'Multiple replicas enable load balancing for inference requests.' + 'Multiple replicas enable load balancing for inference requests.', + 'models.table.list.empty': 'No Models yet!', + 'models.table.list.getStart': + 'Get started with DeepSeek-R1-Distill-Qwen-1.5B' }; diff --git a/src/locales/zh-CN/models.ts b/src/locales/zh-CN/models.ts index 86900154..ca5bca1b 100644 --- a/src/locales/zh-CN/models.ts +++ b/src/locales/zh-CN/models.ts @@ -99,5 +99,8 @@ export default { '指向包含 .safetensors, config.json 文件的模型目录,例如 /usr/local/models/model/', 'models.localpath.chunks.tips': '指向模型第一个分片文件,例如 /usr/local/models/model-00001-of-00004.gguf', - 'models.form.replicas.tips': '多副本数实现推理请求的负载均衡' + 'models.form.replicas.tips': '多副本数实现推理请求的负载均衡', + 'models.table.list.empty': '暂无已部署模型', + 'models.table.list.getStart': + '一键部署DeepSeek-R1-Distill-Qwen-1.5B立即使用!' }; diff --git a/src/pages/llmodels/components/catalog-list.tsx b/src/pages/llmodels/components/catalog-list.tsx index b519956b..5fd68fa1 100644 --- a/src/pages/llmodels/components/catalog-list.tsx +++ b/src/pages/llmodels/components/catalog-list.tsx @@ -28,7 +28,7 @@ const ListSkeleton: React.FC<{ width: '100%', position: 'absolute', display: 'flex', - alignItems: 'center', + alignItems: 'flex-start', justifyContent: 'center', top: 0, left: 0, diff --git a/src/pages/llmodels/components/data-form.tsx b/src/pages/llmodels/components/data-form.tsx index f32efc67..7a8957c5 100644 --- a/src/pages/llmodels/components/data-form.tsx +++ b/src/pages/llmodels/components/data-form.tsx @@ -668,7 +668,8 @@ const DataForm: React.FC = forwardRef((props, ref) => { { label: 'vox-box', value: backendOptionsMap.voxBox, - disabled: props.source === modelSourceMap.ollama_library_value + disabled: + props.source === modelSourceMap.ollama_library_value || isGGUF } ] } diff --git a/src/pages/llmodels/components/table-list.tsx b/src/pages/llmodels/components/table-list.tsx index e7d33630..68e08d15 100644 --- a/src/pages/llmodels/components/table-list.tsx +++ b/src/pages/llmodels/components/table-list.tsx @@ -60,7 +60,6 @@ import { } from '../apis'; import { InstanceRealtimeLogStatus, - backendOptionsMap, getSourceRepoConfigValue, modelCategories, modelCategoriesMap, @@ -699,9 +698,6 @@ const Models: React.FC = ({ }; const columns: SealColumnProps[] = useMemo(() => { - if (isFirstLogin) { - return []; - } return [ { title: intl.formatMessage({ id: 'common.table.name' }), @@ -779,31 +775,26 @@ const Models: React.FC = ({ ) } ]; - }, [sortOrder, intl, isFirstLogin]); + }, [sortOrder, intl]); const handleOnClick = async () => { if (isLoading) { return; } - const data = catalogList?.find( - (item) => item.backend === backendOptionsMap.llamaBox && item.size === 1.5 - ); - console.log('catalogList=======', data); + const data = catalogList?.[0] || {}; try { - if (data) { - setIsLoading(true); - const modelData = await createModel({ - data: data - }); - writeState(IS_FIRST_LOGIN, false); - setIsFirstLogin(false); - setTimeout(() => { - updateExpandedRowKeys([modelData.id]); - }, 300); - message.success(intl.formatMessage({ id: 'common.message.success' })); - handleSearch?.(); - } + setIsLoading(true); + const modelData = await createModel({ + data: data + }); + writeState(IS_FIRST_LOGIN, false); + setIsFirstLogin(false); + setTimeout(() => { + updateExpandedRowKeys([modelData.id]); + }, 300); + message.success(intl.formatMessage({ id: 'common.message.success' })); + handleSearch?.(); } catch (error) { // ingore } finally { @@ -811,7 +802,7 @@ const Models: React.FC = ({ } }; const renderEmpty = useMemo(() => { - if (dataSource.length || !isFirstLogin) { + if (dataSource.length || !isFirstLogin || !catalogList?.length) { return null; } return ( @@ -821,19 +812,21 @@ const Models: React.FC = ({ > - No Models yet! + {intl.formatMessage({ id: 'models.table.list.empty' })}
); - }, [dataSource.length, isFirstLogin, isLoading]); + }, [dataSource.length, isFirstLogin, isLoading, intl]); return ( <> diff --git a/src/pages/llmodels/components/update-modal.tsx b/src/pages/llmodels/components/update-modal.tsx index e4cff12c..d06005bb 100644 --- a/src/pages/llmodels/components/update-modal.tsx +++ b/src/pages/llmodels/components/update-modal.tsx @@ -566,7 +566,8 @@ const UpdateModal: React.FC = (props) => { label: 'vox-box', value: backendOptionsMap.voxBox, disabled: - props.data?.source === modelSourceMap.ollama_library_value + props.data?.source === + modelSourceMap.ollama_library_value || isGGUF } ]} disabled={ diff --git a/src/pages/llmodels/index.tsx b/src/pages/llmodels/index.tsx index 01e3e2c3..701f4682 100644 --- a/src/pages/llmodels/index.tsx +++ b/src/pages/llmodels/index.tsx @@ -19,6 +19,7 @@ import { queryModelsList } from './apis'; import TableList from './components/table-list'; +import { backendOptionsMap } from './config'; import { ListItem } from './config/types'; const Models: React.FC = () => { @@ -266,7 +267,17 @@ const Models: React.FC = () => { item.name = name; return item; }); - setCatalogList(list || []); + const deepseekr1dstill = _.toLower('DeepSeek-R1-Distill-Qwen-1.5B'); + const resultList = list?.filter((item: any) => { + return ( + item.backend === backendOptionsMap.llamaBox && + (_.toLower(item?.huggingface_repo_id)?.indexOf(deepseekr1dstill) > + -1 || + _.toLower(item?.model_scope_model_id)?.indexOf(deepseekr1dstill) > + -1) + ); + }); + setCatalogList(resultList || []); } catch (error) { // ignore } diff --git a/src/pages/playground/components/ground-embedding.tsx b/src/pages/playground/components/ground-embedding.tsx index 82546929..d2da277a 100644 --- a/src/pages/playground/components/ground-embedding.tsx +++ b/src/pages/playground/components/ground-embedding.tsx @@ -9,8 +9,8 @@ import useRequestToken from '@/hooks/use-request-token'; import { ClearOutlined, HolderOutlined, - InfoCircleOutlined, PlusOutlined, + QuestionCircleOutlined, SendOutlined } from '@ant-design/icons'; import { useIntl } from '@umijs/max'; @@ -496,7 +496,7 @@ const GroundEmbedding: React.FC = forwardRef((props, ref) => { {intl.formatMessage({ id: 'playground.input.multiplePaste' })} - + @@ -607,7 +607,7 @@ const GroundEmbedding: React.FC = forwardRef((props, ref) => { } > - + = forwardRef((props, ref) => { {intl.formatMessage({ id: 'playground.input.multiplePaste' })} - +