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
This commit is contained in:
Faisal Amir 2024-11-18 09:24:54 +07:00 committed by GitHub
parent f5a709b268
commit c548381590
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,8 +19,10 @@ import { getConfigurationsData } from '@/utils/componentSettings'
import { serverEnabledAtom } from '@/helpers/atoms/LocalServer.atom' import { serverEnabledAtom } from '@/helpers/atoms/LocalServer.atom'
import { selectedModelAtom } from '@/helpers/atoms/Model.atom' import { selectedModelAtom } from '@/helpers/atoms/Model.atom'
import { getActiveThreadModelParamsAtom } from '@/helpers/atoms/Thread.atom'
const LocalServerRightPanel = () => { const LocalServerRightPanel = () => {
const activeModelParams = useAtomValue(getActiveThreadModelParamsAtom)
const loadModelError = useAtomValue(loadModelErrorAtom) const loadModelError = useAtomValue(loadModelErrorAtom)
const serverEnabled = useAtomValue(serverEnabledAtom) const serverEnabled = useAtomValue(serverEnabledAtom)
const setModalTroubleShooting = useSetAtom(modalTroubleShootingAtom) const setModalTroubleShooting = useSetAtom(modalTroubleShootingAtom)
@ -48,8 +50,17 @@ const LocalServerRightPanel = () => {
selectedModel selectedModel
) )
const modelEngineParams = extractModelLoadParams(
{
...selectedModel?.settings,
...activeModelParams,
},
selectedModel?.settings
)
const componentDataEngineSetting = getConfigurationsData( const componentDataEngineSetting = getConfigurationsData(
currentModelSettingParams modelEngineParams,
selectedModel
) )
const engineSettings = useMemo( const engineSettings = useMemo(
@ -57,6 +68,7 @@ const LocalServerRightPanel = () => {
componentDataEngineSetting.filter( componentDataEngineSetting.filter(
(x) => x.key !== 'prompt_template' && x.key !== 'embedding' (x) => x.key !== 'prompt_template' && x.key !== 'embedding'
), ),
[componentDataEngineSetting] [componentDataEngineSetting]
) )