chore: check configuration on initial and change values
This commit is contained in:
@@ -67,9 +67,10 @@ export default {
|
|||||||
'The default storage directory is <span class="desc-block">/var/lib/gpustack/cache</span> or the directory specified with <span class="desc-block">--data-dir</span>.',
|
'The default storage directory is <span class="desc-block">/var/lib/gpustack/cache</span> or the directory specified with <span class="desc-block">--data-dir</span>.',
|
||||||
'resources.modelfiles.retry.download': 'Retry Download',
|
'resources.modelfiles.retry.download': 'Retry Download',
|
||||||
'resources.modelfiles.storagePath.holder':
|
'resources.modelfiles.storagePath.holder':
|
||||||
'Waiting for download to complete...',
|
'Waiting for the download to complete...',
|
||||||
'resources.filter.worker': 'Filter by Worker',
|
'resources.filter.worker': 'Filter by Worker',
|
||||||
'resources.filter.source': 'Filter by Source',
|
'resources.filter.source': 'Filter by Source',
|
||||||
'resources.modelfiles.delete.tips': 'Also delete the file from disk!',
|
'resources.modelfiles.delete.tips': 'Also delete the file from disk!',
|
||||||
'resources.modelfiles.copy.tips': 'Copy Full Path'
|
'resources.modelfiles.copy.tips': 'Copy Full Path',
|
||||||
|
'resources.filter.path': 'Filter by Path'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ export default {
|
|||||||
'resources.filter.worker': 'Filter by Worker',
|
'resources.filter.worker': 'Filter by Worker',
|
||||||
'resources.filter.source': 'Filter by Source',
|
'resources.filter.source': 'Filter by Source',
|
||||||
'resources.modelfiles.delete.tips': 'Also delete the file from disk!',
|
'resources.modelfiles.delete.tips': 'Also delete the file from disk!',
|
||||||
'resources.modelfiles.copy.tips': 'Copy Full Path'
|
'resources.modelfiles.copy.tips': 'Copy Full Path',
|
||||||
|
'resources.filter.path': 'Filter by Path'
|
||||||
};
|
};
|
||||||
|
|
||||||
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
||||||
@@ -91,4 +92,5 @@ export default {
|
|||||||
// 13. 'resources.worker.add.step1',
|
// 13. 'resources.worker.add.step1',
|
||||||
// 14. 'resources.worker.add.step2.tips',
|
// 14. 'resources.worker.add.step2.tips',
|
||||||
// 15. 'resources.modelfiles.copy.tips',
|
// 15. 'resources.modelfiles.copy.tips',
|
||||||
|
// 16. 'resources.filter.path',
|
||||||
// ========== End of To-Do List ==========
|
// ========== End of To-Do List ==========
|
||||||
|
|||||||
@@ -13,10 +13,14 @@ export default {
|
|||||||
'resources.form.enablePartialOffload': 'Разрешить оффлоуд на CPU',
|
'resources.form.enablePartialOffload': 'Разрешить оффлоуд на CPU',
|
||||||
'resources.form.placementStrategy': 'Стратегия размещения',
|
'resources.form.placementStrategy': 'Стратегия размещения',
|
||||||
'resources.form.workerSelector': 'Селектор воркеров',
|
'resources.form.workerSelector': 'Селектор воркеров',
|
||||||
'resources.form.enableDistributedInferenceAcrossWorkers': 'Разрешить распределённый инференс между воркерами',
|
'resources.form.enableDistributedInferenceAcrossWorkers':
|
||||||
'resources.form.spread.tips': 'Равномерно распределяет ресурсы между воркерами. Может увеличить фрагментацию ресурсов на отдельных воркерах.',
|
'Разрешить распределённый инференс между воркерами',
|
||||||
'resources.form.binpack.tips': 'Максимизирует утилизацию ресурсов, уменьшая фрагментацию на воркерах/GPU.',
|
'resources.form.spread.tips':
|
||||||
'resources.form.workerSelector.description': 'Система выбирает подходящие GPU/воркеры для развертывания моделей на основе меток.',
|
'Равномерно распределяет ресурсы между воркерами. Может увеличить фрагментацию ресурсов на отдельных воркерах.',
|
||||||
|
'resources.form.binpack.tips':
|
||||||
|
'Максимизирует утилизацию ресурсов, уменьшая фрагментацию на воркерах/GPU.',
|
||||||
|
'resources.form.workerSelector.description':
|
||||||
|
'Система выбирает подходящие GPU/воркеры для развертывания моделей на основе меток.',
|
||||||
'resources.table.ip': 'IP-адрес',
|
'resources.table.ip': 'IP-адрес',
|
||||||
'resources.table.cpu': 'CPU',
|
'resources.table.cpu': 'CPU',
|
||||||
'resources.table.memory': 'ОЗУ',
|
'resources.table.memory': 'ОЗУ',
|
||||||
@@ -37,14 +41,19 @@ export default {
|
|||||||
'resources.table.wokers': 'воркеры',
|
'resources.table.wokers': 'воркеры',
|
||||||
'resources.worker.linuxormaxos': 'Linux или macOS',
|
'resources.worker.linuxormaxos': 'Linux или macOS',
|
||||||
'resources.table.unified': 'Объединённая память',
|
'resources.table.unified': 'Объединённая память',
|
||||||
'resources.worker.add.step1': 'Получить токен <span class="note-text">(Запустить на сервере)</span>',
|
'resources.worker.add.step1':
|
||||||
|
'Получить токен <span class="note-text">(Запустить на сервере)</span>',
|
||||||
'resources.worker.add.step2': 'Зарегистрировать воркер',
|
'resources.worker.add.step2': 'Зарегистрировать воркер',
|
||||||
'resources.worker.add.step2.tips': 'Примечание: выполнить на подключаемом воркере, <span style="color: #000;font-weight: 600">mytoken</span> это токен, полученный на первом шаге',
|
'resources.worker.add.step2.tips':
|
||||||
'resources.worker.add.step3': 'После успешной регистрации обновите список воркеров.',
|
'Примечание: выполнить на подключаемом воркере, <span style="color: #000;font-weight: 600">mytoken</span> это токен, полученный на первом шаге',
|
||||||
|
'resources.worker.add.step3':
|
||||||
|
'После успешной регистрации обновите список воркеров.',
|
||||||
'resources.worker.container.supported': 'Только для Linux.',
|
'resources.worker.container.supported': 'Только для Linux.',
|
||||||
'resources.worker.current.version': 'Текущая версия: {version}',
|
'resources.worker.current.version': 'Текущая версия: {version}',
|
||||||
'resources.worker.driver.install': 'Установите необходимые драйверы и библиотеки перед установкой GPUStack.',
|
'resources.worker.driver.install':
|
||||||
'resources.worker.select.command': 'Выберите метку для генерации команды и скопируйте её.',
|
'Установите необходимые драйверы и библиотеки перед установкой GPUStack.',
|
||||||
|
'resources.worker.select.command':
|
||||||
|
'Выберите метку для генерации команды и скопируйте её.',
|
||||||
'resources.worker.script.install': 'Установка скриптом',
|
'resources.worker.script.install': 'Установка скриптом',
|
||||||
'resources.worker.container.install': 'Установка контейнером (только Linux)',
|
'resources.worker.container.install': 'Установка контейнером (только Linux)',
|
||||||
'resources.worker.cann.tips': `Укажите индексы GPU через <span style='color: #000;font-weight: 600'>ASCEND_VISIBLE_DEVICES=0,1,2,3</span> или <span style='color: #000;font-weight: 600'>ASCEND_VISIBLE_DEVICES=0-3</span>.`,
|
'resources.worker.cann.tips': `Укажите индексы GPU через <span style='color: #000;font-weight: 600'>ASCEND_VISIBLE_DEVICES=0,1,2,3</span> или <span style='color: #000;font-weight: 600'>ASCEND_VISIBLE_DEVICES=0-3</span>.`,
|
||||||
@@ -54,15 +63,17 @@ export default {
|
|||||||
'resources.modelfiles.size': 'Размер',
|
'resources.modelfiles.size': 'Размер',
|
||||||
'resources.modelfiles.selecttarget': 'Выбрать назначение',
|
'resources.modelfiles.selecttarget': 'Выбрать назначение',
|
||||||
'resources.modelfiles.form.localdir': 'Локальный каталог',
|
'resources.modelfiles.form.localdir': 'Локальный каталог',
|
||||||
'resources.modelfiles.form.localdir.tips': 'Каталог по умолчанию <span class="desc-block>/var/lib/gpustack/cache</span> или каталог, указанный через <span class="desc-block">--data-dir</span>.',
|
'resources.modelfiles.form.localdir.tips':
|
||||||
|
'Каталог по умолчанию <span class="desc-block>/var/lib/gpustack/cache</span> или каталог, указанный через <span class="desc-block">--data-dir</span>.',
|
||||||
'resources.modelfiles.retry.download': 'Повторить загрузку',
|
'resources.modelfiles.retry.download': 'Повторить загрузку',
|
||||||
'resources.modelfiles.storagePath.holder': 'Ожидание завершения загрузки...',
|
'resources.modelfiles.storagePath.holder': 'Ожидание завершения загрузки...',
|
||||||
'resources.filter.worker': 'Фильтровать по узлу',
|
'resources.filter.worker': 'Фильтровать по узлу',
|
||||||
'resources.filter.source': 'Фильтровать по источнику',
|
'resources.filter.source': 'Фильтровать по источнику',
|
||||||
'resources.modelfiles.delete.tips': 'Также удалить файл с диска!',
|
'resources.modelfiles.delete.tips': 'Также удалить файл с диска!',
|
||||||
'resources.modelfiles.copy.tips': 'Скопировать полный путь'
|
'resources.modelfiles.copy.tips': 'Скопировать полный путь',
|
||||||
|
'resources.filter.path': 'Filter by Path'
|
||||||
};
|
};
|
||||||
|
|
||||||
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
// ========== To-Do: Translate Keys (Remove After Translation) ==========
|
||||||
|
// 1. 'resources.filter.path'
|
||||||
// ========== End of To-Do List ==========
|
// ========== End of To-Do List ==========
|
||||||
|
|||||||
@@ -69,5 +69,6 @@ export default {
|
|||||||
'resources.filter.worker': '按 worker 筛选',
|
'resources.filter.worker': '按 worker 筛选',
|
||||||
'resources.filter.source': '按来源筛选',
|
'resources.filter.source': '按来源筛选',
|
||||||
'resources.modelfiles.delete.tips': '同时从磁盘删除文件!',
|
'resources.modelfiles.delete.tips': '同时从磁盘删除文件!',
|
||||||
'resources.modelfiles.copy.tips': '复制完整路径'
|
'resources.modelfiles.copy.tips': '复制完整路径',
|
||||||
|
'resources.filter.path': '路径查询'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
setWarningStatus,
|
setWarningStatus,
|
||||||
handleEvaluate,
|
handleEvaluate,
|
||||||
generateGPUIds,
|
generateGPUIds,
|
||||||
|
cancelEvaluate,
|
||||||
|
submitAnyway,
|
||||||
handleOnValuesChange,
|
handleOnValuesChange,
|
||||||
warningStatus
|
warningStatus
|
||||||
} = useCheckCompatibility();
|
} = useCheckCompatibility();
|
||||||
@@ -99,7 +101,6 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
const axiosToken = useRef<any>(null);
|
const axiosToken = useRef<any>(null);
|
||||||
const selectSpecRef = useRef<CatalogSpec>({} as CatalogSpec);
|
const selectSpecRef = useRef<CatalogSpec>({} as CatalogSpec);
|
||||||
const specListRef = useRef<any[]>([]);
|
const specListRef = useRef<any[]>([]);
|
||||||
const submitAnyway = useRef<any>(null);
|
|
||||||
|
|
||||||
const handleSumit = () => {
|
const handleSumit = () => {
|
||||||
form.current?.submit?.();
|
form.current?.submit?.();
|
||||||
@@ -111,9 +112,11 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const generateSubmitData = (formData: FormData) => {
|
const generateSubmitData = (formData: FormData) => {
|
||||||
|
const gpuSelector = generateGPUIds(formData);
|
||||||
const data = {
|
const data = {
|
||||||
..._.omit(selectSpecRef.current, ['name']),
|
..._.omit(selectSpecRef.current, ['name']),
|
||||||
...formData
|
...formData,
|
||||||
|
...gpuSelector
|
||||||
};
|
};
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@@ -233,6 +236,12 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
return evalutionData;
|
return evalutionData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleCheckFormData = () => {
|
||||||
|
const values = form.current?.getFieldsValue();
|
||||||
|
const allValues = generateSubmitData(values);
|
||||||
|
handleCheckCompatibility(allValues);
|
||||||
|
};
|
||||||
|
|
||||||
const handleSourceChange = (source: string) => {
|
const handleSourceChange = (source: string) => {
|
||||||
const defaultSpec = _.get(sourceGroupMap.current, `${source}.0`, {});
|
const defaultSpec = _.get(sourceGroupMap.current, `${source}.0`, {});
|
||||||
initFormDataBySource(defaultSpec);
|
initFormDataBySource(defaultSpec);
|
||||||
@@ -245,8 +254,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
});
|
});
|
||||||
// set form value
|
// set form value
|
||||||
initFormDataBySource(defaultSpec);
|
initFormDataBySource(defaultSpec);
|
||||||
const data = generateSubmitData(form.current.getFieldsValue());
|
handleCheckFormData();
|
||||||
handleCheckCompatibility(data);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const checkSize = (list: any[]) => {
|
const checkSize = (list: any[]) => {
|
||||||
@@ -314,7 +322,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
form.current.setFieldsValue({
|
form.current.setFieldsValue({
|
||||||
...data
|
...data
|
||||||
});
|
});
|
||||||
handleCheckCompatibility(data);
|
handleCheckFormData();
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchSpecData = async () => {
|
const fetchSpecData = async () => {
|
||||||
@@ -364,12 +372,14 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
'name',
|
'name',
|
||||||
_.toLower(current.name).replace(/\s/g, '-') || ''
|
_.toLower(current.name).replace(/\s/g, '-') || ''
|
||||||
);
|
);
|
||||||
if (defaultSpec.backend === backendOptionsMap.vllm) {
|
|
||||||
setIsGGUF(false);
|
const allValues = generateSubmitData(defaultSpec);
|
||||||
}
|
handleCheckCompatibility(allValues);
|
||||||
|
|
||||||
if (defaultSpec.backend === backendOptionsMap.llamaBox) {
|
if (defaultSpec.backend === backendOptionsMap.llamaBox) {
|
||||||
setIsGGUF(true);
|
setIsGGUF(true);
|
||||||
|
} else {
|
||||||
|
setIsGGUF(false);
|
||||||
}
|
}
|
||||||
console.log('values====', form.current.form.getFieldsValue());
|
console.log('values====', form.current.form.getFieldsValue());
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -386,8 +396,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
form.current.setFieldsValue({
|
form.current.setFieldsValue({
|
||||||
...data
|
...data
|
||||||
});
|
});
|
||||||
const allValues = generateSubmitData(data);
|
handleCheckFormData();
|
||||||
handleCheckCompatibility(allValues);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOnSizeChange = (val: number) => {
|
const handleOnSizeChange = (val: number) => {
|
||||||
@@ -408,21 +417,12 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
form.current.setFieldsValue({
|
form.current.setFieldsValue({
|
||||||
...data
|
...data
|
||||||
});
|
});
|
||||||
const allValues = generateSubmitData(data);
|
handleCheckFormData();
|
||||||
handleCheckCompatibility(allValues);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOk = async (values: FormData) => {
|
const handleOk = async (values: FormData) => {
|
||||||
const data = generateSubmitData(values);
|
const data = generateSubmitData(values);
|
||||||
|
onOk(data);
|
||||||
if (submitAnyway.current) {
|
|
||||||
onOk(data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const evaluateResult = await handleCheckCompatibility(data);
|
|
||||||
if (evaluateResult?.compatible) {
|
|
||||||
onOk(data);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCancel = useCallback(() => {
|
const handleCancel = useCallback(() => {
|
||||||
@@ -436,6 +436,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
}
|
}
|
||||||
return () => {
|
return () => {
|
||||||
axiosToken.current?.cancel?.();
|
axiosToken.current?.cancel?.();
|
||||||
|
cancelEvaluate();
|
||||||
setWarningStatus({
|
setWarningStatus({
|
||||||
show: false,
|
show: false,
|
||||||
title: '',
|
title: '',
|
||||||
|
|||||||
@@ -117,16 +117,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
|
|
||||||
const handleOnOk = async (allValues: FormData) => {
|
const handleOnOk = async (allValues: FormData) => {
|
||||||
const result = getSourceRepoConfigValue(props.source, allValues).values;
|
const result = getSourceRepoConfigValue(props.source, allValues).values;
|
||||||
if (submitAnyway.current) {
|
onOk(result);
|
||||||
onOk(result);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const evalutionData = await handleEvaluate(result);
|
|
||||||
handleShowCompatibleAlert?.(evalutionData);
|
|
||||||
if (evalutionData?.compatible) {
|
|
||||||
onOk(result);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSubmitAnyway = async () => {
|
const handleSubmitAnyway = async () => {
|
||||||
@@ -198,22 +189,25 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
onCancel?.();
|
onCancel?.();
|
||||||
}, [onCancel]);
|
}, [onCancel]);
|
||||||
|
|
||||||
useEffect(() => {
|
const handleOnOpen = useCallback(() => {
|
||||||
if (!open) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (props.deploymentType === 'modelFiles') {
|
if (props.deploymentType === 'modelFiles') {
|
||||||
form.current?.form?.setFieldsValue({
|
form.current?.form?.setFieldsValue({
|
||||||
...props.initialValues
|
...props.initialValues
|
||||||
});
|
});
|
||||||
setIsGGUF(props.isGGUF || false);
|
|
||||||
} else {
|
} else {
|
||||||
const backend =
|
const backend =
|
||||||
source === modelSourceMap.ollama_library_value
|
source === modelSourceMap.ollama_library_value
|
||||||
? backendOptionsMap.llamaBox
|
? backendOptionsMap.llamaBox
|
||||||
: backendOptionsMap.vllm;
|
: backendOptionsMap.vllm;
|
||||||
form.current?.setFieldValue?.('backend', backend);
|
form.current?.setFieldValue?.('backend', backend);
|
||||||
setIsGGUF(backend === backendOptionsMap.llamaBox);
|
}
|
||||||
|
}, [source, props.initialValues, props.deploymentType]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!open) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
handleOnOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
@@ -225,7 +219,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
});
|
});
|
||||||
checkTokenRef.current?.cancel();
|
checkTokenRef.current?.cancel();
|
||||||
};
|
};
|
||||||
}, [open, props.isGGUF, source, props.initialValues, props.deploymentType]);
|
}, [open, handleOnOpen]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Drawer
|
<Drawer
|
||||||
|
|||||||
@@ -597,7 +597,7 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
|||||||
</span>
|
</span>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={4}>
|
<Col span={4}>
|
||||||
<span style={{ paddingLeft: 45 }} className="flex">
|
<span style={{ paddingLeft: 43 }} className="flex">
|
||||||
<AutoTooltip ghost>
|
<AutoTooltip ghost>
|
||||||
{dayjs(instanceData.created_at).format('YYYY-MM-DD HH:mm:ss')}
|
{dayjs(instanceData.created_at).format('YYYY-MM-DD HH:mm:ss')}
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
|||||||
value: item.name,
|
value: item.name,
|
||||||
label: item.name,
|
label: item.name,
|
||||||
isGGUF: checkIsGGUF(item),
|
isGGUF: checkIsGGUF(item),
|
||||||
source: modelSourceMap.modelscope_value
|
source: modelSource
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return list;
|
return list;
|
||||||
@@ -161,7 +161,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
|||||||
tags: item.Tags,
|
tags: item.Tags,
|
||||||
libraries: item.Libraries,
|
libraries: item.Libraries,
|
||||||
isGGUF: checkIsGGUF({ tags: item.Tags, libraries: item.Libraries }),
|
isGGUF: checkIsGGUF({ tags: item.Tags, libraries: item.Libraries }),
|
||||||
source: modelSourceMap.modelscope_value
|
source: modelSource
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -182,11 +182,13 @@ const Models: React.FC<ModelsProps> = ({
|
|||||||
hasLinuxWorker?: boolean;
|
hasLinuxWorker?: boolean;
|
||||||
source: SourceType;
|
source: SourceType;
|
||||||
gpuOptions: any[];
|
gpuOptions: any[];
|
||||||
|
isGGUF?: boolean;
|
||||||
modelFileOptions?: any[];
|
modelFileOptions?: any[];
|
||||||
}>({
|
}>({
|
||||||
show: false,
|
show: false,
|
||||||
hasLinuxWorker: false,
|
hasLinuxWorker: false,
|
||||||
width: 600,
|
width: 600,
|
||||||
|
isGGUF: false,
|
||||||
source: modelSourceMap.huggingface_value as SourceType,
|
source: modelSourceMap.huggingface_value as SourceType,
|
||||||
gpuOptions: [],
|
gpuOptions: [],
|
||||||
modelFileOptions: []
|
modelFileOptions: []
|
||||||
@@ -830,6 +832,7 @@ const Models: React.FC<ModelsProps> = ({
|
|||||||
title={intl.formatMessage({ id: 'models.button.deploy' })}
|
title={intl.formatMessage({ id: 'models.button.deploy' })}
|
||||||
source={openDeployModal.source}
|
source={openDeployModal.source}
|
||||||
width={openDeployModal.width}
|
width={openDeployModal.width}
|
||||||
|
isGGUF={openDeployModal.isGGUF}
|
||||||
hasLinuxWorker={openDeployModal.hasLinuxWorker}
|
hasLinuxWorker={openDeployModal.hasLinuxWorker}
|
||||||
gpuOptions={openDeployModal.gpuOptions}
|
gpuOptions={openDeployModal.gpuOptions}
|
||||||
modelFileOptions={openDeployModal.modelFileOptions || []}
|
modelFileOptions={openDeployModal.modelFileOptions || []}
|
||||||
|
|||||||
@@ -311,23 +311,12 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
|
|||||||
submitData = {
|
submitData = {
|
||||||
..._.omit(formdata, ['scheduleType']),
|
..._.omit(formdata, ['scheduleType']),
|
||||||
categories: formdata.categories ? [formdata.categories] : [],
|
categories: formdata.categories ? [formdata.categories] : [],
|
||||||
worker_selector: null,
|
worker_selector:
|
||||||
|
formdata.scheduleType === 'manual' ? null : formdata.worker_selector,
|
||||||
...obj,
|
...obj,
|
||||||
...(formdata.scheduleType === 'manual'
|
...generateGPUIds(formdata)
|
||||||
? generateGPUIds(formdata)
|
|
||||||
: { gpu_selector: null })
|
|
||||||
};
|
};
|
||||||
|
onOk(submitData);
|
||||||
if (submitAnyway.current) {
|
|
||||||
onOk(submitData);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const evalutionData = await handleEvaluate(submitData);
|
|
||||||
handleShowCompatibleAlert?.(evalutionData);
|
|
||||||
if (evalutionData?.compatible) {
|
|
||||||
onOk(submitData);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onValuesChange = (changedValues: any, allValues: any) => {
|
const onValuesChange = (changedValues: any, allValues: any) => {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const icons = {
|
|||||||
|
|
||||||
export const modalConfig: Record<
|
export const modalConfig: Record<
|
||||||
string,
|
string,
|
||||||
{ show: boolean; width: string | number; source: any }
|
{ show: boolean; width: string | number; source: any; isGGUF?: boolean }
|
||||||
> = {
|
> = {
|
||||||
huggingface: {
|
huggingface: {
|
||||||
show: true,
|
show: true,
|
||||||
@@ -39,6 +39,7 @@ export const modalConfig: Record<
|
|||||||
ollama_library: {
|
ollama_library: {
|
||||||
show: true,
|
show: true,
|
||||||
width: 600,
|
width: 600,
|
||||||
|
isGGUF: true,
|
||||||
source: modelSourceMap.ollama_library_value
|
source: modelSourceMap.ollama_library_value
|
||||||
},
|
},
|
||||||
modelscope: {
|
modelscope: {
|
||||||
|
|||||||
@@ -413,6 +413,11 @@ export const useCheckCompatibility = () => {
|
|||||||
|
|
||||||
const debounceHandleValuesChange = _.debounce(handleOnValuesChange, 300);
|
const debounceHandleValuesChange = _.debounce(handleOnValuesChange, 300);
|
||||||
|
|
||||||
|
const cancelEvaluate = () => {
|
||||||
|
checkTokenRef.current?.cancel();
|
||||||
|
checkTokenRef.current = null;
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
checkTokenRef.current?.cancel();
|
checkTokenRef.current?.cancel();
|
||||||
@@ -429,6 +434,7 @@ export const useCheckCompatibility = () => {
|
|||||||
submitAnyway,
|
submitAnyway,
|
||||||
generateGPUIds,
|
generateGPUIds,
|
||||||
handleEvaluate,
|
handleEvaluate,
|
||||||
setWarningStatus
|
setWarningStatus,
|
||||||
|
cancelEvaluate
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ const ModelFiles = () => {
|
|||||||
<FilterBar
|
<FilterBar
|
||||||
actionType="dropdown"
|
actionType="dropdown"
|
||||||
selectHolder="resources.filter.worker"
|
selectHolder="resources.filter.worker"
|
||||||
inputHolder="resources.filter.source"
|
inputHolder="resources.filter.path"
|
||||||
buttonText={intl.formatMessage({ id: 'resources.modelfiles.download' })}
|
buttonText={intl.formatMessage({ id: 'resources.modelfiles.download' })}
|
||||||
handleSelectChange={handleWorkerChange}
|
handleSelectChange={handleWorkerChange}
|
||||||
handleDeleteByBatch={handleDeleteByBatch}
|
handleDeleteByBatch={handleDeleteByBatch}
|
||||||
|
|||||||
Reference in New Issue
Block a user