chore: display the direct command in add worker
This commit is contained in:
@@ -153,6 +153,21 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
||||
const collapseItems = useMemo(() => {
|
||||
const children = (
|
||||
<>
|
||||
{/* <Form.Item<FormData> name="labels">
|
||||
<ListInput
|
||||
placeholder={
|
||||
backendParamsHolderTips[backend]
|
||||
? intl.formatMessage({
|
||||
id: backendParamsHolderTips[backend].holder
|
||||
})
|
||||
: ''
|
||||
}
|
||||
btnText="models.form.button.addlabel"
|
||||
label="Labels"
|
||||
dataList={form.getFieldValue('backend_parameters') || []}
|
||||
options={modelLabels}
|
||||
></ListInput>
|
||||
</Form.Item> */}
|
||||
<Form.Item name="scheduleType">
|
||||
<SealSelect
|
||||
label={intl.formatMessage({ id: 'models.form.scheduletype' })}
|
||||
|
||||
@@ -508,38 +508,54 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
min={0}
|
||||
></SealInput.Number>
|
||||
</Form.Item>
|
||||
<Form.Item name="backend" id="backend-field">
|
||||
<SealSelect
|
||||
onChange={handleBackendChange}
|
||||
label={intl.formatMessage({ id: 'models.form.backend' })}
|
||||
options={[
|
||||
{
|
||||
label: `llama-box`,
|
||||
value: backendOptionsMap.llamaBox,
|
||||
disabled:
|
||||
props.source === modelSourceMap.local_path_value
|
||||
? false
|
||||
: !isGGUF
|
||||
},
|
||||
{
|
||||
label: 'vLLM',
|
||||
value: backendOptionsMap.vllm,
|
||||
disabled:
|
||||
props.source === modelSourceMap.local_path_value
|
||||
? false
|
||||
: isGGUF
|
||||
},
|
||||
{
|
||||
label: 'vox-box',
|
||||
value: backendOptionsMap.voxBox,
|
||||
disabled: props.source === modelSourceMap.ollama_library_value
|
||||
<Form.Item name="backend">
|
||||
<div id="backend-field">
|
||||
<SealSelect
|
||||
onChange={handleBackendChange}
|
||||
label={intl.formatMessage({ id: 'models.form.backend' })}
|
||||
description={
|
||||
<div>
|
||||
<div>
|
||||
1.{' '}
|
||||
{intl.formatMessage({ id: 'models.form.backend.llamabox' })}
|
||||
</div>
|
||||
<div>
|
||||
2. {intl.formatMessage({ id: 'models.form.backend.vllm' })}
|
||||
</div>
|
||||
<div>
|
||||
3. {intl.formatMessage({ id: 'models.form.backend.voxbox' })}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
]}
|
||||
disabled={
|
||||
action === PageAction.EDIT &&
|
||||
props.source !== modelSourceMap.local_path_value
|
||||
}
|
||||
></SealSelect>
|
||||
options={[
|
||||
{
|
||||
label: `llama-box`,
|
||||
value: backendOptionsMap.llamaBox,
|
||||
disabled:
|
||||
props.source === modelSourceMap.local_path_value
|
||||
? false
|
||||
: !isGGUF
|
||||
},
|
||||
{
|
||||
label: 'vLLM',
|
||||
value: backendOptionsMap.vllm,
|
||||
disabled:
|
||||
props.source === modelSourceMap.local_path_value
|
||||
? false
|
||||
: isGGUF
|
||||
},
|
||||
{
|
||||
label: 'vox-box',
|
||||
value: backendOptionsMap.voxBox,
|
||||
disabled: props.source === modelSourceMap.ollama_library_value
|
||||
}
|
||||
]}
|
||||
disabled={
|
||||
action === PageAction.EDIT &&
|
||||
props.source !== modelSourceMap.local_path_value
|
||||
}
|
||||
></SealSelect>
|
||||
</div>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData> name="description">
|
||||
<SealInput.TextArea
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import ModalFooter from '@/components/modal-footer';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import useDriver from '@/hooks/use-driver';
|
||||
import { CloseOutlined } from '@ant-design/icons';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Button, Drawer } from 'antd';
|
||||
@@ -58,9 +57,10 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
modelSourceMap.huggingface_value,
|
||||
modelSourceMap.modelscope_value
|
||||
];
|
||||
const { start } = useDriver({
|
||||
steps
|
||||
});
|
||||
// const { start } = useDriver({
|
||||
// steps,
|
||||
// id: 'deploy-model'
|
||||
// });
|
||||
const form = useRef<any>({});
|
||||
const intl = useIntl();
|
||||
const [selectedModel, setSelectedModel] = useState<any>({});
|
||||
@@ -128,7 +128,9 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
|
||||
// useEffect(() => {
|
||||
// if (open && loadfinish) {
|
||||
// start();
|
||||
// setTimeout(() => {
|
||||
// start();
|
||||
// }, 1000);
|
||||
// }
|
||||
// }, [loadfinish, open]);
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
ListItem as WorkerListItem
|
||||
} from '@/pages/resources/config/types';
|
||||
import {
|
||||
DeleteOutlined,
|
||||
FieldTimeOutlined,
|
||||
FileSyncOutlined,
|
||||
InfoCircleOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { useIntl } from '@umijs/max';
|
||||
@@ -71,12 +71,12 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
||||
icon: <FieldTimeOutlined />
|
||||
},
|
||||
{
|
||||
label: 'common.button.recreate',
|
||||
label: 'common.button.delrecreate',
|
||||
key: 'delete',
|
||||
props: {
|
||||
danger: false
|
||||
danger: true
|
||||
},
|
||||
icon: <FileSyncOutlined />
|
||||
icon: <DeleteOutlined />
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { BulbOutlined, InfoCircleOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
BulbOutlined,
|
||||
QuestionCircleOutlined,
|
||||
WarningOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Checkbox, Select, Tooltip } from 'antd';
|
||||
import _ from 'lodash';
|
||||
@@ -233,6 +237,12 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
||||
onChange={handleSearchInputChange}
|
||||
modelSource={modelSource}
|
||||
></SearchInput>
|
||||
<div className="gguf-tips">
|
||||
<WarningOutlined className="font-size-14 m-r-5 warning" />
|
||||
<span>
|
||||
{intl.formatMessage({ id: 'models.form.search.gguftips' })}
|
||||
</span>
|
||||
</div>
|
||||
<div className={SearchStyle.filter}>
|
||||
<span>
|
||||
<span className="value">
|
||||
@@ -268,7 +278,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
||||
}
|
||||
>
|
||||
GGUF
|
||||
<InfoCircleOutlined className="m-l-4" />
|
||||
<QuestionCircleOutlined className="m-l-4" />
|
||||
</Tooltip>
|
||||
</Checkbox>
|
||||
</span>
|
||||
@@ -318,6 +328,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{
|
||||
<SearchResult
|
||||
loading={dataSource.loading}
|
||||
|
||||
@@ -87,7 +87,7 @@ const SearchResult: React.FC<SearchResultProps> = (props) => {
|
||||
);
|
||||
};
|
||||
return (
|
||||
<SimpleBar style={{ height: 'calc(100vh - 194px)' }}>
|
||||
<SimpleBar style={{ height: 'calc(100vh - 224px)' }}>
|
||||
<div style={{ ...props.style }} className="search-result-wrap">
|
||||
<Spin spinning={props.loading}>
|
||||
<div style={{ minHeight: 200 }}>
|
||||
|
||||
@@ -449,7 +449,7 @@ const Models: React.FC<ModelsProps> = ({
|
||||
const handleDeleteInstace = (row: any, list: ModelInstanceListItem[]) => {
|
||||
modalRef.current.show({
|
||||
content: 'models.instances',
|
||||
okText: 'common.button.recreate',
|
||||
okText: 'common.button.delrecreate',
|
||||
name: row.name,
|
||||
async onOk() {
|
||||
await deleteModelInstance(row.id);
|
||||
|
||||
@@ -345,3 +345,11 @@ export const getVllmCliArgs = (inputString: string) => {
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
export const modelLabels = [
|
||||
{ label: 'Image', value: 'image_only' },
|
||||
{ label: 'Text-to-speech', value: 'text_to_speech' },
|
||||
{ label: 'Speech-to-text', value: 'speech_to_text' },
|
||||
{ label: 'reranker', value: 'reranker' },
|
||||
{ label: 'Embedding', value: 'embedding_only' }
|
||||
];
|
||||
|
||||
@@ -104,6 +104,10 @@ const options = [
|
||||
{
|
||||
label: '--image-no-vae-tiling',
|
||||
value: '--image-no-vae-tiling'
|
||||
},
|
||||
{
|
||||
label: '--mmproj',
|
||||
value: '--mmproj'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -8,6 +8,17 @@
|
||||
// height: calc(100vh - 194px);
|
||||
}
|
||||
|
||||
.gguf-tips {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8px 0;
|
||||
color: var(--ant-color-text-secondary);
|
||||
|
||||
.warning {
|
||||
color: var(--ant-color-warning);
|
||||
}
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
Reference in New Issue
Block a user