fix: remove advanced agrs in image
This commit is contained in:
@@ -95,6 +95,7 @@ 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 noCompatibleGPUsRef = useRef<boolean>(false);
|
||||||
|
|
||||||
const handleSumit = () => {
|
const handleSumit = () => {
|
||||||
form.current?.submit?.();
|
form.current?.submit?.();
|
||||||
@@ -142,6 +143,10 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleCheckCompatibility = async (formData: FormData) => {
|
const handleCheckCompatibility = async (formData: FormData) => {
|
||||||
|
// no compatible gpus, do nothing
|
||||||
|
if (noCompatibleGPUsRef.current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
handleDoEvalute(formData);
|
handleDoEvalute(formData);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -165,6 +170,11 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
..._.omit(selectSpecRef.current, ['name']),
|
..._.omit(selectSpecRef.current, ['name']),
|
||||||
...allValues
|
...allValues
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// no compatible gpus, do nothing
|
||||||
|
if (noCompatibleGPUsRef.current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
handleOnValuesChange?.({
|
handleOnValuesChange?.({
|
||||||
changedValues,
|
changedValues,
|
||||||
allValues: data,
|
allValues: data,
|
||||||
@@ -254,6 +264,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
|
|
||||||
// If no avaliable gpus for the model, show warning message
|
// If no avaliable gpus for the model, show warning message
|
||||||
if (!res.items.length) {
|
if (!res.items.length) {
|
||||||
|
noCompatibleGPUsRef.current = true;
|
||||||
setWarningStatus({
|
setWarningStatus({
|
||||||
show: true,
|
show: true,
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
@@ -261,6 +272,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
noCompatibleGPUsRef.current = false;
|
||||||
handleCheckCompatibility(allValues);
|
handleCheckCompatibility(allValues);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// ignore
|
// ignore
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ export const ImageconstExtraConfig: ParamsSchema[] = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
export const ImageAdvancedParamsConfig: ParamsSchema[] = [
|
const advancedConfig = [
|
||||||
{
|
{
|
||||||
type: 'Select',
|
type: 'Select',
|
||||||
name: 'sample_method',
|
name: 'sample_method',
|
||||||
@@ -458,7 +458,10 @@ export const ImageAdvancedParamsConfig: ParamsSchema[] = [
|
|||||||
required: false
|
required: false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export const ImageAdvancedParamsConfig: ParamsSchema[] = [
|
||||||
{
|
{
|
||||||
type: 'InputNumber',
|
type: 'InputNumber',
|
||||||
name: 'seed',
|
name: 'seed',
|
||||||
|
|||||||
Reference in New Issue
Block a user