fix: vox-box gpu-selector

main
jialin 1 year ago
parent f1ab927a7e
commit 11d824a88d

@ -1 +1 @@
src/components/icon-font/iconfont/iconfont.js
src/components/icon-font/iconfont.js

@ -5,5 +5,6 @@ module.exports = {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/class-name-casing': 'off'
}
},
ignorePatterns: ['public/static/']
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -124,7 +124,7 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
}, []);
const handleGPUSelectorChange = (gpuIds: any[]) => {
console.log('GPU Selector Change:', gpuIds);
// only handle for vllm, pick the last selected group
if (
backend === backendOptionsMap.llamaBox ||
backend === backendOptionsMap.voxBox ||
@ -135,9 +135,6 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
const lastGroupName = gpuIds[gpuIds.length - 1][0];
const lastGroupItems = gpuIds.filter((item) => item[0] === lastGroupName);
console.log('Last Group Items:', lastGroupItems);
form.setFieldValue(['gpu_selector', 'gpu_ids'], lastGroupItems);
};

@ -515,12 +515,18 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
return {};
}
const result = _.map(gpu_ids, (item: string[][] | string[]) => {
if (Array.isArray(item)) {
return item[1];
}
return item;
});
const result = _.reduce(
gpu_ids,
(acc: string[], item: string | string[], index: number) => {
if (Array.isArray(item)) {
acc.push(item[1]);
} else if (index === 1) {
acc.push(item);
}
return acc;
},
[]
);
if (result.length) {
return {

@ -379,12 +379,18 @@ const UpdateModal: React.FC<AddModalProps> = (props) => {
return {};
}
const result = _.map(gpu_ids, (item: string[][] | string[]) => {
if (Array.isArray(item)) {
return item[1];
}
return item;
});
const result = _.reduce(
gpu_ids,
(acc: string[], item: string | string[], index: number) => {
if (Array.isArray(item)) {
acc.push(item[1]);
} else if (index === 1) {
acc.push(item);
}
return acc;
},
[]
);
if (result.length) {
return {

Loading…
Cancel
Save