fix: wrong desc setting cont_batching (#6034)

This commit is contained in:
Faisal Amir 2025-08-02 21:48:43 +07:00 committed by GitHub
parent 3acb61b5ed
commit 787c4ee073
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 1 deletions

View File

@ -153,7 +153,7 @@
{ {
"key": "cont_batching", "key": "cont_batching",
"title": "Continuous Batching", "title": "Continuous Batching",
"description": "Enable continuous batching (a.k.a dynamic batching) for concurrent requests (default: enabled).", "description": "Enable continuous batching (a.k.a dynamic batching) for concurrent requests.",
"controllerType": "checkbox", "controllerType": "checkbox",
"controllerProps": { "controllerProps": {
"value": false "value": false

View File

@ -210,6 +210,29 @@ export const useModelProvider = create<ModelProviderState>()(
{ {
name: localStorageKey.modelProvider, name: localStorageKey.modelProvider,
storage: createJSONStorage(() => localStorage), storage: createJSONStorage(() => localStorage),
migrate: (persistedState: unknown, version: number) => {
const state = persistedState as ModelProviderState
// Migration for cont_batching description update (version 0 -> 1)
if (version === 0 && state?.providers) {
state.providers = state.providers.map((provider) => {
if (provider.provider === 'llamacpp' && provider.settings) {
provider.settings = provider.settings.map((setting) => {
if (setting.key === 'cont_batching') {
return {
...setting,
description: 'Enable continuous batching (a.k.a dynamic batching) for concurrent requests.'
}
}
return setting
})
}
return provider
})
}
return state
},
version: 1,
} }
) )
) )