浏览代码

feat: gpt4 max token set to 8k (#67)

tags/0.2.2
Joel 2 年前
父节点
当前提交
ce492d13f1
没有帐户链接到提交者的电子邮件
共有 3 个文件被更改,包括 14 次插入1 次删除
  1. 12
    1
      web/app/components/app/configuration/config-model/index.tsx
  2. 1
    0
      web/i18n/lang/common.en.ts
  3. 1
    0
      web/i18n/lang/common.zh.ts

+ 12
- 1
web/app/components/app/configuration/config-model/index.tsx 查看文件

import { Cog8ToothIcon, InformationCircleIcon, ChevronDownIcon } from '@heroicons/react/24/outline' import { Cog8ToothIcon, InformationCircleIcon, ChevronDownIcon } from '@heroicons/react/24/outline'
import { AppType } from '@/types/app' import { AppType } from '@/types/app'
import { TONE_LIST } from '@/config' import { TONE_LIST } from '@/config'
import Toast from '@/app/components/base/toast'


export type IConifgModelProps = { export type IConifgModelProps = {
mode: string mode: string
key: 'max_tokens', key: 'max_tokens',
tip: t('common.model.params.maxTokenTip'), tip: t('common.model.params.maxTokenTip'),
step: 100, step: 100,
max: 4000,
max: modelId === 'gpt-4' ? 8000 : 4000,
}, },
] ]


onShowUseGPT4Confirm() onShowUseGPT4Confirm()
return return
} }
if(id !== 'gpt-4' && completionParams.max_tokens > 4000) {
Toast.notify({
type: 'warning',
message: t('common.model.params.setToCurrentModelMaxTokenTip')
})
onCompletionParamsChange({
...completionParams,
max_tokens: 4000
})
}
setModelId(id) setModelId(id)
} }
} }

+ 1
- 0
web/i18n/lang/common.en.ts 查看文件

maxToken: 'Max token', maxToken: 'Max token',
maxTokenTip: maxTokenTip:
'Max tokens generated is 2,048 or 4,000, depending on the model. Prompt and completion share this limit. One token is roughly 1 English character.', 'Max tokens generated is 2,048 or 4,000, depending on the model. Prompt and completion share this limit. One token is roughly 1 English character.',
setToCurrentModelMaxTokenTip: 'Max token is updated to the maximum token of the current model 4,000.',
}, },
tone: { tone: {
Creative: 'Creative', Creative: 'Creative',

+ 1
- 0
web/i18n/lang/common.zh.ts 查看文件

maxToken: '最大 Token', maxToken: '最大 Token',
maxTokenTip: maxTokenTip:
'生成的最大令牌数为 2,048 或 4,000,取决于模型。提示和完成共享令牌数限制。一个令牌约等于 1 个英文或 4 个中文字符。', '生成的最大令牌数为 2,048 或 4,000,取决于模型。提示和完成共享令牌数限制。一个令牌约等于 1 个英文或 4 个中文字符。',
setToCurrentModelMaxTokenTip: '最大令牌数更新为当前模型最大的令牌数 4,000。',
}, },
tone: { tone: {
Creative: '创意', Creative: '创意',

正在加载...
取消
保存