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,
|
InputComponentProps,
|
||||||
CheckboxComponentProps,
|
CheckboxComponentProps,
|
||||||
SliderComponentProps,
|
SliderComponentProps,
|
||||||
|
InferenceEngine,
|
||||||
} from '@janhq/core'
|
} from '@janhq/core'
|
||||||
|
|
||||||
import { useAtomValue } from 'jotai/react'
|
import { useAtomValue } from 'jotai/react'
|
||||||
@ -37,7 +38,9 @@ const SettingComponent: React.FC<Props> = ({
|
|||||||
description={data.description}
|
description={data.description}
|
||||||
min={min}
|
min={min}
|
||||||
max={
|
max={
|
||||||
data.key === 'max_tokens'
|
data.key === 'max_tokens' &&
|
||||||
|
activeThread &&
|
||||||
|
activeThread.assistants[0].model.engine === InferenceEngine.nitro
|
||||||
? Number(
|
? Number(
|
||||||
activeThread &&
|
activeThread &&
|
||||||
activeThread.assistants[0].model.settings.ctx_len
|
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.',
|
'The context length for model operations varies; the maximum depends on the specific model used.',
|
||||||
controllerType: 'slider',
|
controllerType: 'slider',
|
||||||
controllerProps: {
|
controllerProps: {
|
||||||
min: 0,
|
min: 128,
|
||||||
max: 4096,
|
max: 4096,
|
||||||
step: 128,
|
step: 128,
|
||||||
value: 2048,
|
value: 2048,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user