chore: get start from deploying
This commit is contained in:
@@ -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':
|
||||
'<span style="margin-right: 5px;font-size: 13px;">Get started with</span> <span style="font-size: 14px;font-weight: 700">DeepSeek-R1-Distill-Qwen-1.5B</span>'
|
||||
};
|
||||
|
||||
@@ -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':
|
||||
'<span style="margin-right: 5px;font-size: 13px;">一键部署</span><span style="font-size: 14px;font-weight: 700">DeepSeek-R1-Distill-Qwen-1.5B</span><span style="margin-left: 5px;font-size: 13px;">立即使用!</span>'
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -668,7 +668,8 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
{
|
||||
label: 'vox-box',
|
||||
value: backendOptionsMap.voxBox,
|
||||
disabled: props.source === modelSourceMap.ollama_library_value
|
||||
disabled:
|
||||
props.source === modelSourceMap.ollama_library_value || isGGUF
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -60,7 +60,6 @@ import {
|
||||
} from '../apis';
|
||||
import {
|
||||
InstanceRealtimeLogStatus,
|
||||
backendOptionsMap,
|
||||
getSourceRepoConfigValue,
|
||||
modelCategories,
|
||||
modelCategoriesMap,
|
||||
@@ -699,9 +698,6 @@ const Models: React.FC<ModelsProps> = ({
|
||||
};
|
||||
|
||||
const columns: SealColumnProps[] = useMemo(() => {
|
||||
if (isFirstLogin) {
|
||||
return [];
|
||||
}
|
||||
return [
|
||||
{
|
||||
title: intl.formatMessage({ id: 'common.table.name' }),
|
||||
@@ -779,31 +775,26 @@ const Models: React.FC<ModelsProps> = ({
|
||||
)
|
||||
}
|
||||
];
|
||||
}, [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<ModelsProps> = ({
|
||||
}
|
||||
};
|
||||
const renderEmpty = useMemo(() => {
|
||||
if (dataSource.length || !isFirstLogin) {
|
||||
if (dataSource.length || !isFirstLogin || !catalogList?.length) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
@@ -821,19 +812,21 @@ const Models: React.FC<ModelsProps> = ({
|
||||
>
|
||||
<Empty description=""></Empty>
|
||||
<Typography.Title level={4} style={{ marginBottom: 30 }}>
|
||||
No Models yet!
|
||||
{intl.formatMessage({ id: 'models.table.list.empty' })}
|
||||
</Typography.Title>
|
||||
<div>
|
||||
<Button type="primary" onClick={handleOnClick} loading={isLoading}>
|
||||
<span style={{ fontSize: 13 }}>Get started with</span>
|
||||
<span style={{ fontSize: 14, fontWeight: 700 }}>
|
||||
DeepSeek-R1-Distill-Qwen-1.5B
|
||||
</span>
|
||||
<span
|
||||
className="flex-center"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: intl.formatMessage({ id: 'models.table.list.getStart' })
|
||||
}}
|
||||
></span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}, [dataSource.length, isFirstLogin, isLoading]);
|
||||
}, [dataSource.length, isFirstLogin, isLoading, intl]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -566,7 +566,8 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
||||
label: 'vox-box',
|
||||
value: backendOptionsMap.voxBox,
|
||||
disabled:
|
||||
props.data?.source === modelSourceMap.ollama_library_value
|
||||
props.data?.source ===
|
||||
modelSourceMap.ollama_library_value || isGGUF
|
||||
}
|
||||
]}
|
||||
disabled={
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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<MessageProps> = forwardRef((props, ref) => {
|
||||
{intl.formatMessage({
|
||||
id: 'playground.input.multiplePaste'
|
||||
})}
|
||||
<InfoCircleOutlined className="m-l-4" />
|
||||
<QuestionCircleOutlined className="m-l-4" />
|
||||
</Checkbox>
|
||||
</Tooltip>
|
||||
|
||||
@@ -607,7 +607,7 @@ const GroundEmbedding: React.FC<MessageProps> = forwardRef((props, ref) => {
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<InfoCircleOutlined className="m-l-4" />
|
||||
<QuestionCircleOutlined className="m-l-4" />
|
||||
</Tooltip>
|
||||
</span>
|
||||
<AlertInfo
|
||||
|
||||
@@ -5,8 +5,8 @@ import useOverlayScroller from '@/hooks/use-overlay-scroller';
|
||||
import useRequestToken from '@/hooks/use-request-token';
|
||||
import {
|
||||
ClearOutlined,
|
||||
InfoCircleOutlined,
|
||||
PlusOutlined,
|
||||
QuestionCircleOutlined,
|
||||
SendOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { useIntl } from '@umijs/max';
|
||||
@@ -523,7 +523,7 @@ const GroundReranker: React.FC<MessageProps> = forwardRef((props, ref) => {
|
||||
{intl.formatMessage({
|
||||
id: 'playground.input.multiplePaste'
|
||||
})}
|
||||
<InfoCircleOutlined className="m-l-4" />
|
||||
<QuestionCircleOutlined className="m-l-4" />
|
||||
</Checkbox>
|
||||
</Tooltip>
|
||||
<Button size="middle" onClick={handleAddText}>
|
||||
|
||||
Reference in New Issue
Block a user