From c54838159075600ecb5791af924015e5dc242034 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Mon, 18 Nov 2024 09:24:54 +0700 Subject: [PATCH] fix: api local server max ctx len not update when switch model (#4027) * fix: api local server max ctx len not update when switch model * chore: remove log --- .../LocalServer/LocalServerRightPanel/index.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/web/screens/LocalServer/LocalServerRightPanel/index.tsx b/web/screens/LocalServer/LocalServerRightPanel/index.tsx index a59e83e7e..f0a11a865 100644 --- a/web/screens/LocalServer/LocalServerRightPanel/index.tsx +++ b/web/screens/LocalServer/LocalServerRightPanel/index.tsx @@ -19,8 +19,10 @@ import { getConfigurationsData } from '@/utils/componentSettings' import { serverEnabledAtom } from '@/helpers/atoms/LocalServer.atom' import { selectedModelAtom } from '@/helpers/atoms/Model.atom' +import { getActiveThreadModelParamsAtom } from '@/helpers/atoms/Thread.atom' const LocalServerRightPanel = () => { + const activeModelParams = useAtomValue(getActiveThreadModelParamsAtom) const loadModelError = useAtomValue(loadModelErrorAtom) const serverEnabled = useAtomValue(serverEnabledAtom) const setModalTroubleShooting = useSetAtom(modalTroubleShootingAtom) @@ -48,8 +50,17 @@ const LocalServerRightPanel = () => { selectedModel ) + const modelEngineParams = extractModelLoadParams( + { + ...selectedModel?.settings, + ...activeModelParams, + }, + selectedModel?.settings + ) + const componentDataEngineSetting = getConfigurationsData( - currentModelSettingParams + modelEngineParams, + selectedModel ) const engineSettings = useMemo( @@ -57,6 +68,7 @@ const LocalServerRightPanel = () => { componentDataEngineSetting.filter( (x) => x.key !== 'prompt_template' && x.key !== 'embedding' ), + [componentDataEngineSetting] )