Merge pull request #4294 from janhq/fix/context-length-is-reset-on-thread-create

fix: context length is reset while creating a new thread
This commit is contained in:
Louis 2024-12-19 10:02:13 +07:00 committed by GitHub
commit 9c5bda758d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,13 +112,15 @@ export const useCreateNewThread = () => {
)
const overriddenSettings = {
ctx_len: !isLocalEngine(model?.engine) ? undefined : defaultContextLength,
ctx_len: !isLocalEngine(defaultModel?.engine)
? undefined
: defaultContextLength,
}
// Use ctx length by default
const overriddenParameters = {
max_tokens: !isLocalEngine(model?.engine)
? (model?.parameters.token_limit ?? 8192)
max_tokens: !isLocalEngine(defaultModel?.engine)
? (defaultModel?.parameters.token_limit ?? 8192)
: defaultContextLength,
}