Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
ce492d13
Unverified
Commit
ce492d13
authored
May 17, 2023
by
Joel
Committed by
GitHub
May 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: gpt4 max token set to 8k (#67)
parent
74d95461
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
index.tsx
web/app/components/app/configuration/config-model/index.tsx
+12
-1
common.en.ts
web/i18n/lang/common.en.ts
+1
-0
common.zh.ts
web/i18n/lang/common.zh.ts
+1
-0
No files found.
web/app/components/app/configuration/config-model/index.tsx
View file @
ce492d13
...
@@ -11,6 +11,7 @@ import type { CompletionParams } from '@/models/debug'
...
@@ -11,6 +11,7 @@ import type { CompletionParams } from '@/models/debug'
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
...
@@ -93,7 +94,7 @@ const ConifgModel: FC<IConifgModelProps> = ({
...
@@ -93,7 +94,7 @@ const ConifgModel: FC<IConifgModelProps> = ({
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
,
},
},
]
]
...
@@ -114,6 +115,16 @@ const ConifgModel: FC<IConifgModelProps> = ({
...
@@ -114,6 +115,16 @@ const ConifgModel: FC<IConifgModelProps> = ({
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
)
}
}
}
}
...
...
web/i18n/lang/common.en.ts
View file @
ce492d13
...
@@ -50,6 +50,7 @@ const translation = {
...
@@ -50,6 +50,7 @@ const translation = {
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'
,
...
...
web/i18n/lang/common.zh.ts
View file @
ce492d13
...
@@ -50,6 +50,7 @@ const translation = {
...
@@ -50,6 +50,7 @@ const translation = {
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
:
'创意'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment