update ernie models (#6454)

This commit is contained in:
Weaxs 2024-07-19 13:08:39 +08:00 committed by GitHub
parent a5fcd91ba5
commit ea45496a74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 79 additions and 1 deletions

View File

@ -35,3 +35,4 @@ parameter_rules:
zh_Hans: 禁用模型自行进行外部搜索。 zh_Hans: 禁用模型自行进行外部搜索。
en_US: Disable the model to perform external search. en_US: Disable the model to perform external search.
required: false required: false
deprecated: true

View File

@ -0,0 +1,40 @@
model: ernie-4.0-turbo-8k
label:
en_US: Ernie-4.0-turbo-8K
model_type: llm
features:
- agent-thought
model_properties:
mode: chat
context_size: 8192
parameter_rules:
- name: temperature
use_template: temperature
min: 0.1
max: 1.0
default: 0.8
- name: top_p
use_template: top_p
- name: max_tokens
use_template: max_tokens
default: 1024
min: 2
max: 2048
- name: presence_penalty
use_template: presence_penalty
default: 1.0
min: 1.0
max: 2.0
- name: frequency_penalty
use_template: frequency_penalty
- name: response_format
use_template: response_format
- name: disable_search
label:
zh_Hans: 禁用搜索
en_US: Disable Search
type: boolean
help:
zh_Hans: 禁用模型自行进行外部搜索。
en_US: Disable the model to perform external search.
required: false

View File

@ -28,3 +28,4 @@ parameter_rules:
default: 1.0 default: 1.0
min: 1.0 min: 1.0
max: 2.0 max: 2.0
deprecated: true

View File

@ -0,0 +1,30 @@
model: ernie-character-8k-0321
label:
en_US: ERNIE-Character-8K
model_type: llm
features:
- agent-thought
model_properties:
mode: chat
context_size: 8192
parameter_rules:
- name: temperature
use_template: temperature
min: 0.1
max: 1.0
default: 0.95
- name: top_p
use_template: top_p
min: 0
max: 1.0
default: 0.7
- name: max_tokens
use_template: max_tokens
default: 1024
min: 2
max: 1024
- name: presence_penalty
use_template: presence_penalty
default: 1.0
min: 1.0
max: 2.0

View File

@ -28,3 +28,4 @@ parameter_rules:
default: 1.0 default: 1.0
min: 1.0 min: 1.0
max: 2.0 max: 2.0
deprecated: true

View File

@ -28,3 +28,4 @@ parameter_rules:
default: 1.0 default: 1.0
min: 1.0 min: 1.0
max: 2.0 max: 2.0
deprecated: true

View File

@ -97,6 +97,7 @@ class BaiduAccessToken:
baidu_access_tokens_lock.release() baidu_access_tokens_lock.release()
return token return token
class ErnieMessage: class ErnieMessage:
class Role(Enum): class Role(Enum):
USER = 'user' USER = 'user'
@ -137,7 +138,9 @@ class ErnieBotModel:
'ernie-speed-appbuilder': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ai_apaas', 'ernie-speed-appbuilder': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ai_apaas',
'ernie-lite-8k-0922': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant', 'ernie-lite-8k-0922': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant',
'ernie-lite-8k-0308': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie-lite-8k', 'ernie-lite-8k-0308': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie-lite-8k',
'ernie-character-8k': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie-char-8k',
'ernie-character-8k-0321': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie-char-8k', 'ernie-character-8k-0321': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie-char-8k',
'ernie-4.0-tutbo-8k': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie-4.0-turbo-8k',
'ernie-4.0-tutbo-8k-preview': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie-4.0-turbo-8k-preview', 'ernie-4.0-tutbo-8k-preview': 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/ernie-4.0-turbo-8k-preview',
} }
@ -149,7 +152,8 @@ class ErnieBotModel:
'ernie-3.5-8k-1222', 'ernie-3.5-8k-1222',
'ernie-3.5-4k-0205', 'ernie-3.5-4k-0205',
'ernie-3.5-128k', 'ernie-3.5-128k',
'ernie-4.0-8k' 'ernie-4.0-8k',
'ernie-4.0-turbo-8k',
'ernie-4.0-turbo-8k-preview' 'ernie-4.0-turbo-8k-preview'
] ]