diff --git a/optuna_dashboard/_app.py b/optuna_dashboard/_app.py index 7007fdae..04a41d29 100644 --- a/optuna_dashboard/_app.py +++ b/optuna_dashboard/_app.py @@ -443,7 +443,7 @@ def create_app(storage: BaseStorage, debug: bool = False) -> Bottle: study = optuna.load_study(storage=storage, study_name=study_name) try: - study.tell(trial_id, values=values, state=state) + study._storage.set_trial_state_values(trial_id, state, values) except Exception as e: response.status = 400 # Bad request return {"reason": e.args} diff --git a/optuna_dashboard/ts/components/TrialTable.tsx b/optuna_dashboard/ts/components/TrialTable.tsx index ffc60ba1..c6bb58bb 100644 --- a/optuna_dashboard/ts/components/TrialTable.tsx +++ b/optuna_dashboard/ts/components/TrialTable.tsx @@ -1,10 +1,8 @@ import React, { - ChangeEvent, createRef, FC, FormEvent, MouseEvent, - useState, } from "react" import { Typography, @@ -293,9 +291,8 @@ export const TrialTable: FC<{ const studyId = (studyDetail as StudyDetail).id const trialId = trials[index].number const objectiveValues = objectiveFormRefs.map((ref) => - ref.current ? ref.current.value : "" + ref.current ? Number(ref.current.value) : NaN ) - console.dir(objectiveValues) action.tellTrial(studyId, trialId, "Complete", objectiveValues) } const handleFailTrial = (e: MouseEvent): void => { @@ -346,6 +343,7 @@ export const TrialTable: FC<{ {objectiveFormRefs !== undefined && objectiveFormRefs.map((ref, i) => ( ))}