fix: validate context length (#2871)
* fix: adjust context_length min and conditional for remote model * fix: remove console
This commit is contained in:
parent
1e3e5a83f4
commit
9effb6a3a6
@ -3,6 +3,7 @@ import {
|
||||
InputComponentProps,
|
||||
CheckboxComponentProps,
|
||||
SliderComponentProps,
|
||||
InferenceEngine,
|
||||
} from '@janhq/core'
|
||||
|
||||
import { useAtomValue } from 'jotai/react'
|
||||
@ -37,7 +38,9 @@ const SettingComponent: React.FC<Props> = ({
|
||||
description={data.description}
|
||||
min={min}
|
||||
max={
|
||||
data.key === 'max_tokens'
|
||||
data.key === 'max_tokens' &&
|
||||
activeThread &&
|
||||
activeThread.assistants[0].model.engine === InferenceEngine.nitro
|
||||
? Number(
|
||||
activeThread &&
|
||||
activeThread.assistants[0].model.settings.ctx_len
|
||||
|
||||
@ -33,7 +33,7 @@ export const presetConfiguration: Record<string, SettingComponentProps> = {
|
||||
'The context length for model operations varies; the maximum depends on the specific model used.',
|
||||
controllerType: 'slider',
|
||||
controllerProps: {
|
||||
min: 0,
|
||||
min: 128,
|
||||
max: 4096,
|
||||
step: 128,
|
||||
value: 2048,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user