Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f4ea23dd14 | ||
|
|
5bd0020e49 |
@@ -257,7 +257,6 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
if (requestModelId !== getRequestId()) {
|
if (requestModelId !== getRequestId()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('handleSelectModelFile:', item, selectedModel);
|
|
||||||
|
|
||||||
const modelInfo = onSelectModel(selectedModel, props.source);
|
const modelInfo = onSelectModel(selectedModel, props.source);
|
||||||
|
|
||||||
@@ -267,7 +266,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
model_scope_file_path: item.fakeName,
|
model_scope_file_path: item.fakeName,
|
||||||
backend_parameters: [],
|
backend_parameters: [],
|
||||||
backend_version: '',
|
backend_version: '',
|
||||||
backend: '',
|
backend: modelInfo.backend,
|
||||||
env: {},
|
env: {},
|
||||||
categories: getCategory(item)
|
categories: getCategory(item)
|
||||||
});
|
});
|
||||||
@@ -403,6 +402,7 @@ const AddModal: FC<AddModalProps> = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleBackendChange = async (backend: string) => {
|
const handleBackendChange = async (backend: string) => {
|
||||||
|
console.log('handleBackendChange:', backend);
|
||||||
const data = form.current.form.getFieldsValue?.();
|
const data = form.current.form.getFieldsValue?.();
|
||||||
const res = handleBackendChangeBefore(data);
|
const res = handleBackendChangeBefore(data);
|
||||||
if (res.show) {
|
if (res.show) {
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ export const backendOptionsMap = {
|
|||||||
SGLang: 'SGLang'
|
SGLang: 'SGLang'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// for checking built-in backends when selecting a gguf
|
||||||
export const BuiltInBackendOptions = [
|
export const BuiltInBackendOptions = [
|
||||||
|
backendOptionsMap.vllm,
|
||||||
backendOptionsMap.ascendMindie,
|
backendOptionsMap.ascendMindie,
|
||||||
backendOptionsMap.SGLang,
|
backendOptionsMap.SGLang,
|
||||||
backendOptionsMap.voxBox
|
backendOptionsMap.voxBox
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ const CustomBackend: React.FC = () => {
|
|||||||
<SealInput.Input
|
<SealInput.Input
|
||||||
required
|
required
|
||||||
allowClear
|
allowClear
|
||||||
onBlur={handleImageNameOnBlur}
|
|
||||||
label={intl.formatMessage({ id: 'backend.imageName' })}
|
label={intl.formatMessage({ id: 'backend.imageName' })}
|
||||||
></SealInput.Input>
|
></SealInput.Input>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
@@ -65,7 +64,6 @@ const CustomBackend: React.FC = () => {
|
|||||||
required
|
required
|
||||||
scaleSize={false}
|
scaleSize={false}
|
||||||
alwaysFocus={true}
|
alwaysFocus={true}
|
||||||
onBlur={handleRunCommandOnBlur}
|
|
||||||
autoSize={{ minRows: 2, maxRows: 4 }}
|
autoSize={{ minRows: 2, maxRows: 4 }}
|
||||||
label={intl.formatMessage({ id: 'backend.runCommand' })}
|
label={intl.formatMessage({ id: 'backend.runCommand' })}
|
||||||
description={intl.formatMessage({
|
description={intl.formatMessage({
|
||||||
|
|||||||
@@ -241,14 +241,6 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
|||||||
...updateGPUSelector(val)
|
...updateGPUSelector(val)
|
||||||
});
|
});
|
||||||
|
|
||||||
const imageName = form.getFieldValue('image_name');
|
|
||||||
const runCommand = form.getFieldValue('run_command');
|
|
||||||
|
|
||||||
// if the image_name or run_command is empty, set them to default value of the backend
|
|
||||||
|
|
||||||
if (val === backendOptionsMap.custom && !imageName && !runCommand) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
onBackendChange?.(val);
|
onBackendChange?.(val);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -407,6 +407,19 @@ export const useCheckCompatibility = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
backendOptionsMap.custom === allValues.backend &&
|
||||||
|
(!allValues.run_command || !allValues.image_name)
|
||||||
|
) {
|
||||||
|
setWarningStatus({
|
||||||
|
show: false,
|
||||||
|
type: 'warning',
|
||||||
|
isHtml: true,
|
||||||
|
message: ''
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// check gguf: for online and local path
|
// check gguf: for online and local path
|
||||||
if (
|
if (
|
||||||
checkIsGGUFFileOrNotSupport(allValues.local_path, allValues) &&
|
checkIsGGUFFileOrNotSupport(allValues.local_path, allValues) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user