Skip to content

Commit

Permalink
try updating confirmed values in hyperparams
Browse files Browse the repository at this point in the history
  • Loading branch information
bveal52 committed Nov 17, 2024
1 parent 912edfc commit 2f19319
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion apps/frontend/app/components/Parameter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ const Parameter = ({ form, type, index, confirmedValues, setConfirmedValues, ...
};
const Component = remains[type];

const updateConfirmedValues = (index) => {
const updateConfirmedValues = (index, newValues) => {
//get values from form
const values = form.values.hyperparameters[index].values;

//set the new values

form.replaceListItem(`hyperparameters[${index}].values`, newValues);
//update confirmed values
let updatedValues = confirmedValues?.map((item) =>
item.index === index ? { ...item, values: values } : item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const ParamStep = ({ form, confirmedValues, setConfirmedValues, ...props
form.insertListItem('hyperparameters', {
name: '',
default: '',
...((type === 'stringlist') && { values: [] }),
...((type === 'stringlist') && { values: [''] }),
...((type === 'integer' || type === 'float') && {
min: '',
max: '',
Expand Down

0 comments on commit 2f19319

Please sign in to comment.