Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0c7b132d
authored
Oct 22, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: support ERNIE-Bot-4 (close #608)
parent
58b6c88f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
1 deletions
+13
-1
common/model-ratio.go
+1
-0
controller/model.go
+9
-0
controller/relay-text.go
+2
-0
web/src/pages/Channel/EditChannel.js
+1
-1
No files found.
common/model-ratio.go
View file @
0c7b132d
...
@@ -46,6 +46,7 @@ var ModelRatio = map[string]float64{
...
@@ -46,6 +46,7 @@ var ModelRatio = map[string]float64{
"claude-2"
:
5.51
,
// $11.02 / 1M tokens
"claude-2"
:
5.51
,
// $11.02 / 1M tokens
"ERNIE-Bot"
:
0.8572
,
// ¥0.012 / 1k tokens
"ERNIE-Bot"
:
0.8572
,
// ¥0.012 / 1k tokens
"ERNIE-Bot-turbo"
:
0.5715
,
// ¥0.008 / 1k tokens
"ERNIE-Bot-turbo"
:
0.5715
,
// ¥0.008 / 1k tokens
"ERNIE-Bot-4"
:
8.572
,
// ¥0.12 / 1k tokens
"Embedding-V1"
:
0.1429
,
// ¥0.002 / 1k tokens
"Embedding-V1"
:
0.1429
,
// ¥0.002 / 1k tokens
"PaLM-2"
:
1
,
"PaLM-2"
:
1
,
"chatglm_pro"
:
0.7143
,
// ¥0.01 / 1k tokens
"chatglm_pro"
:
0.7143
,
// ¥0.01 / 1k tokens
...
...
controller/model.go
View file @
0c7b132d
...
@@ -307,6 +307,15 @@ func init() {
...
@@ -307,6 +307,15 @@ func init() {
Parent
:
nil
,
Parent
:
nil
,
},
},
{
{
Id
:
"ERNIE-Bot-4"
,
Object
:
"model"
,
Created
:
1677649963
,
OwnedBy
:
"baidu"
,
Permission
:
permission
,
Root
:
"ERNIE-Bot-4"
,
Parent
:
nil
,
},
{
Id
:
"Embedding-V1"
,
Id
:
"Embedding-V1"
,
Object
:
"model"
,
Object
:
"model"
,
Created
:
1677649963
,
Created
:
1677649963
,
...
...
controller/relay-text.go
View file @
0c7b132d
...
@@ -152,6 +152,8 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
...
@@ -152,6 +152,8 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
fullRequestURL
=
"https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions"
fullRequestURL
=
"https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions"
case
"ERNIE-Bot-turbo"
:
case
"ERNIE-Bot-turbo"
:
fullRequestURL
=
"https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant"
fullRequestURL
=
"https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/eb-instant"
case
"ERNIE-Bot-4"
:
fullRequestURL
=
"https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro"
case
"BLOOMZ-7B"
:
case
"BLOOMZ-7B"
:
fullRequestURL
=
"https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/bloomz_7b1"
fullRequestURL
=
"https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/bloomz_7b1"
case
"Embedding-V1"
:
case
"Embedding-V1"
:
...
...
web/src/pages/Channel/EditChannel.js
View file @
0c7b132d
...
@@ -66,7 +66,7 @@ const EditChannel = () => {
...
@@ -66,7 +66,7 @@ const EditChannel = () => {
localModels
=
[
'PaLM-2'
];
localModels
=
[
'PaLM-2'
];
break
;
break
;
case
15
:
case
15
:
localModels
=
[
'ERNIE-Bot'
,
'ERNIE-Bot-turbo'
,
'Embedding-V1'
];
localModels
=
[
'ERNIE-Bot'
,
'ERNIE-Bot-turbo'
,
'E
RNIE-Bot-4'
,
'E
mbedding-V1'
];
break
;
break
;
case
17
:
case
17
:
localModels
=
[
'qwen-turbo'
,
'qwen-plus'
,
'text-embedding-v1'
];
localModels
=
[
'qwen-turbo'
,
'qwen-plus'
,
'text-embedding-v1'
];
...
...
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