fix: reset backend parameter options in deploy model modal
This commit is contained in:
@@ -20,6 +20,7 @@ import _ from 'lodash';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import {
|
||||
backendOptionsMap,
|
||||
backendParamsHolderTips,
|
||||
modelSourceMap,
|
||||
placementStrategyOptions
|
||||
} from '../config';
|
||||
@@ -81,7 +82,13 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
||||
];
|
||||
|
||||
const paramsConfig = useMemo(() => {
|
||||
return backend === backendOptionsMap.llamaBox ? llamaConfig : vllmConfig;
|
||||
if (backend === backendOptionsMap.llamaBox) {
|
||||
return llamaConfig;
|
||||
}
|
||||
if (backend === backendOptionsMap.vllm) {
|
||||
return vllmConfig;
|
||||
}
|
||||
return [];
|
||||
}, [backend]);
|
||||
|
||||
const backendParamsTips = useMemo(() => {
|
||||
@@ -91,10 +98,13 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
||||
link: 'https://github.com/gpustack/llama-box?tab=readme-ov-file#usage'
|
||||
};
|
||||
}
|
||||
return {
|
||||
backend: 'vLLM',
|
||||
link: 'https://docs.vllm.ai/en/stable/serving/openai_compatible_server.html#command-line-arguments-for-the-server'
|
||||
};
|
||||
if (backend === backendOptionsMap.vllm) {
|
||||
return {
|
||||
backend: 'vLLM',
|
||||
link: 'https://docs.vllm.ai/en/stable/serving/openai_compatible_server.html#command-line-arguments-for-the-server'
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}, [backend]);
|
||||
|
||||
const renderSelectTips = (list: Array<{ title: string; tips: string }>) => {
|
||||
@@ -286,39 +296,43 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
|
||||
})}
|
||||
></SealInput.Input>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item<FormData> name="backend_parameters">
|
||||
<ListInput
|
||||
placeholder={
|
||||
backend === backendOptionsMap.llamaBox
|
||||
backendParamsHolderTips[backend]
|
||||
? intl.formatMessage({
|
||||
id: 'models.form.backend_parameters.llamabox.placeholder'
|
||||
})
|
||||
: intl.formatMessage({
|
||||
id: 'models.form.backend_parameters.vllm.placeholder'
|
||||
id: backendParamsHolderTips[backend].holder
|
||||
})
|
||||
: ''
|
||||
}
|
||||
btnText="common.button.addParams"
|
||||
label={intl.formatMessage({ id: 'models.form.backend_parameters' })}
|
||||
label={intl.formatMessage({
|
||||
id: 'models.form.backend_parameters'
|
||||
})}
|
||||
dataList={form.getFieldValue('backend_parameters') || []}
|
||||
onChange={handleBackendParametersChange}
|
||||
options={paramsConfig}
|
||||
description={
|
||||
<span>
|
||||
{intl.formatMessage(
|
||||
{ id: 'models.form.backend_parameters.vllm.tips' },
|
||||
{ backend: backendParamsTips.backend }
|
||||
)}{' '}
|
||||
<Typography.Link
|
||||
style={{ color: 'var(--ant-blue-4)' }}
|
||||
href={backendParamsTips.link}
|
||||
target="_blank"
|
||||
>
|
||||
{intl.formatMessage({ id: 'common.text.here' })}
|
||||
</Typography.Link>
|
||||
</span>
|
||||
backendParamsTips && (
|
||||
<span>
|
||||
{intl.formatMessage(
|
||||
{ id: 'models.form.backend_parameters.vllm.tips' },
|
||||
{ backend: backendParamsTips.backend || '' }
|
||||
)}{' '}
|
||||
<Typography.Link
|
||||
style={{ color: 'var(--ant-blue-4)' }}
|
||||
href={backendParamsTips.link}
|
||||
target="_blank"
|
||||
>
|
||||
{intl.formatMessage({ id: 'common.text.here' })}
|
||||
</Typography.Link>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
></ListInput>
|
||||
</Form.Item>
|
||||
|
||||
{backend === backendOptionsMap.llamaBox && (
|
||||
<div style={{ paddingBottom: 22, paddingLeft: 10 }}>
|
||||
<Form.Item<FormData>
|
||||
|
||||
@@ -2,6 +2,20 @@ import { StatusMaps } from '@/config';
|
||||
import { EditOutlined } from '@ant-design/icons';
|
||||
|
||||
export const ollamaModelOptions = [
|
||||
{
|
||||
label: 'qwen2.5-coder',
|
||||
value: 'qwen2.5-coder',
|
||||
name: 'qwen2.5-coder',
|
||||
id: 'qwen2.5-coder',
|
||||
tags: []
|
||||
},
|
||||
{
|
||||
label: 'llama3.2-vision',
|
||||
value: 'llama3.2-vision',
|
||||
name: 'llama3.2-vision',
|
||||
id: 'llama3.2-vision',
|
||||
tags: []
|
||||
},
|
||||
{
|
||||
label: 'llama3.2',
|
||||
value: 'llama3.2',
|
||||
@@ -9,6 +23,13 @@ export const ollamaModelOptions = [
|
||||
id: 'llama3.2',
|
||||
tags: ['Tools', '1B', '3B']
|
||||
},
|
||||
{
|
||||
label: 'nomic-embed-text',
|
||||
value: 'nomic-embed-text',
|
||||
name: 'nomic-embed-text',
|
||||
id: 'nomic-embed-text',
|
||||
tags: []
|
||||
},
|
||||
{
|
||||
label: 'qwen2.5',
|
||||
value: 'qwen2.5',
|
||||
@@ -73,6 +94,18 @@ export const backendOptionsMap = {
|
||||
voxBox: 'vox-box'
|
||||
};
|
||||
|
||||
export const backendParamsHolderTips = {
|
||||
[backendOptionsMap.llamaBox]: {
|
||||
holder: 'models.form.backend_parameters.llamabox.placeholder',
|
||||
tooltip: 'models.form.backend_parameters.vllm.tips'
|
||||
},
|
||||
[backendOptionsMap.vllm]: {
|
||||
holder: 'models.form.backend_parameters.vllm.placeholder',
|
||||
tooltip: 'models.form.backend_parameters.vllm.tips'
|
||||
},
|
||||
[backendOptionsMap.voxBox]: null
|
||||
};
|
||||
|
||||
export const modelTaskMap = {
|
||||
textToSpeech: 'text-to-speech',
|
||||
speechToText: 'speech-to-text',
|
||||
|
||||
Reference in New Issue
Block a user