Skip to content

Commit 787c4ee

Browse files
authored
fix: wrong desc setting cont_batching (#6034)
1 parent 3acb61b commit 787c4ee

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

extensions/llamacpp-extension/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
{
154154
"key": "cont_batching",
155155
"title": "Continuous Batching",
156-
"description": "Enable continuous batching (a.k.a dynamic batching) for concurrent requests (default: enabled).",
156+
"description": "Enable continuous batching (a.k.a dynamic batching) for concurrent requests.",
157157
"controllerType": "checkbox",
158158
"controllerProps": {
159159
"value": false

web-app/src/hooks/useModelProvider.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,29 @@ export const useModelProvider = create<ModelProviderState>()(
210210
{
211211
name: localStorageKey.modelProvider,
212212
storage: createJSONStorage(() => localStorage),
213+
migrate: (persistedState: unknown, version: number) => {
214+
const state = persistedState as ModelProviderState
215+
216+
// Migration for cont_batching description update (version 0 -> 1)
217+
if (version === 0 && state?.providers) {
218+
state.providers = state.providers.map((provider) => {
219+
if (provider.provider === 'llamacpp' && provider.settings) {
220+
provider.settings = provider.settings.map((setting) => {
221+
if (setting.key === 'cont_batching') {
222+
return {
223+
...setting,
224+
description: 'Enable continuous batching (a.k.a dynamic batching) for concurrent requests.'
225+
}
226+
}
227+
return setting
228+
})
229+
}
230+
return provider
231+
})
232+
}
233+
return state
234+
},
235+
version: 1,
213236
}
214237
)
215238
)

0 commit comments

Comments
 (0)