From 90fe42c9aaeb583015e0d04cf418cbd0656c3856 Mon Sep 17 00:00:00 2001 From: ali asaria Date: Thu, 4 Jan 2024 11:20:30 -0500 Subject: [PATCH] adding an evaluation works --- src/renderer/components/Experiment/Eval/Eval.tsx | 15 +++++++-------- src/renderer/components/MainAppPanel.tsx | 7 ------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/renderer/components/Experiment/Eval/Eval.tsx b/src/renderer/components/Experiment/Eval/Eval.tsx index 59e376f8..8ab4b7f6 100644 --- a/src/renderer/components/Experiment/Eval/Eval.tsx +++ b/src/renderer/components/Experiment/Eval/Eval.tsx @@ -224,14 +224,13 @@ export default function Eval({ const formJson = Object.fromEntries( (formData as any).entries() ); - alert(JSON.stringify(formJson)); - // chatAPI.saveTrainingTemplate( - // event.currentTarget.elements['template_name'].value, - // 'Description', - // 'LoRA', - // JSON.stringify(formJson) - // ); - // addEvaluation(plugin, localName, { task: task }); + // alert(JSON.stringify(formJson)); + + /* The way evals are defined right now, they need a unique name. This is a hack + until we have a better solution */ + const nameOfThisEvaluation = + selectedPlugin + '_' + JSON.stringify(formJson); + addEvaluation(selectedPlugin, nameOfThisEvaluation, formJson); setOpen(false); }} > diff --git a/src/renderer/components/MainAppPanel.tsx b/src/renderer/components/MainAppPanel.tsx index feca1585..6b7c51b4 100644 --- a/src/renderer/components/MainAppPanel.tsx +++ b/src/renderer/components/MainAppPanel.tsx @@ -88,13 +88,6 @@ export default function MainAppPanel({ localName: string, script_template_parameters: any = {} ) { - let currentPlugins = experimentInfo?.config?.plugins; - if (!currentPlugins) { - currentPlugins = []; - } else { - currentPlugins = JSON.parse(currentPlugins); - } - await chatAPI.EXPERIMENT_ADD_EVALUATION( experimentInfo?.id, localName,