diff --git a/frontend/src/pages/FineTuning/Steps/OrderDetails/index.jsx b/frontend/src/pages/FineTuning/Steps/OrderDetails/index.jsx index 6e71db80d934b6b5f5caa3503b0720af8ec14d2e..b0f44a462bf907d1382b3986a13c8d93fc345fd8 100644 --- a/frontend/src/pages/FineTuning/Steps/OrderDetails/index.jsx +++ b/frontend/src/pages/FineTuning/Steps/OrderDetails/index.jsx @@ -8,7 +8,7 @@ export default function OrderDetails({ setSettings, setStep }) { useEffect(() => { FineTuning.info() .then((res) => { - setInfo(res); + setInfo(res ?? {}); setSettings((prev) => { return { ...prev, tuningInfo: res }; }); diff --git a/frontend/src/pages/FineTuning/index.jsx b/frontend/src/pages/FineTuning/index.jsx index f1c293306eaa1c44ab10f3d70a19d6f204990a7c..4406d8310f6f274574a34b9182e22824d4aaa7e1 100644 --- a/frontend/src/pages/FineTuning/index.jsx +++ b/frontend/src/pages/FineTuning/index.jsx @@ -3,7 +3,7 @@ import FineTuningSteps, { FineTuningCreationLayout } from "./Steps"; import { CheckCircle, Circle, Sparkle } from "@phosphor-icons/react"; import { isMobile } from "react-device-detect"; -function SideBarSelection({ currentStep }) { +function SideBarSelection({ setStep, currentStep }) { const currentIndex = Object.keys(FineTuningSteps).indexOf(currentStep); return ( <div @@ -26,7 +26,16 @@ function SideBarSelection({ currentStep }) { isLast ? "" : "border-b border-white/10", ].join(" ")} > - <div className="text-sm font-light">{props.name}</div> + {isDone ? ( + <button + onClick={() => setStep(stepKey)} + className="border-none hover:underline text-white/40 text-sm font-light" + > + {props.name} + </button> + ) : ( + <div className="text-sm font-light">{props.name}</div> + )} <div className="flex items-center gap-x-2"> {isDone ? ( <CheckCircle className={`text-green-300`} /> @@ -60,7 +69,7 @@ export default function FineTuningFlow() { <Sparkle size={24} /> <p className="text-lg font-medium">Custom Fine-Tuned Model</p> </div> - <SideBarSelection currentStep={step} /> + <SideBarSelection setStep={setStep} currentStep={step} /> </div> {StepPage.component({ settings, setSettings, setStep })} </div> diff --git a/server/models/fineTuning.js b/server/models/fineTuning.js index 629cfc015ffae2e1c42b657333844a2d530f7a89..8ca5b84ec16a8fec8b272c133cf44f2cf888ea59 100644 --- a/server/models/fineTuning.js +++ b/server/models/fineTuning.js @@ -72,7 +72,7 @@ const FineTuning = { workspaceId: { in: workspaceIds, }, - ...(feedback === true ? { feedback: 1 } : {}), + ...(feedback === true ? { feedbackScore: true } : {}), }); return count; }, @@ -141,7 +141,7 @@ const FineTuning = { workspaceId: { in: workspaces.map((ws) => ws.id), }, - ...(feedback === true ? { feedback: 1 } : {}), + ...(feedback === true ? { feedbackScore: true } : {}), }); const preparedData = chats.map((chat) => { const responseJson = safeJsonParse(chat.response);