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
79c7d8f4
authored
Aug 25, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: improve model ratio handling for reserved models in getHardcodedCompletionModelRatio
parent
5c7395ad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
setting/ratio_setting/model_ratio.go
+7
-1
No files found.
setting/ratio_setting/model_ratio.go
View file @
79c7d8f4
...
@@ -468,7 +468,13 @@ func GetCompletionRatio(name string) float64 {
...
@@ -468,7 +468,13 @@ func GetCompletionRatio(name string) float64 {
func
getHardcodedCompletionModelRatio
(
name
string
)
(
float64
,
bool
)
{
func
getHardcodedCompletionModelRatio
(
name
string
)
(
float64
,
bool
)
{
lowercaseName
:=
strings
.
ToLower
(
name
)
lowercaseName
:=
strings
.
ToLower
(
name
)
if
strings
.
HasPrefix
(
name
,
"gpt-"
)
&&
!
strings
.
HasSuffix
(
name
,
"-all"
)
&&
!
strings
.
HasSuffix
(
name
,
"-gizmo-*"
)
{
isReservedModel
:=
strings
.
HasSuffix
(
name
,
"-all"
)
||
strings
.
HasSuffix
(
name
,
"-gizmo-*"
)
if
isReservedModel
{
return
2
,
false
}
if
strings
.
HasPrefix
(
name
,
"gpt-"
)
{
if
strings
.
HasPrefix
(
name
,
"gpt-4o"
)
{
if
strings
.
HasPrefix
(
name
,
"gpt-4o"
)
{
if
name
==
"gpt-4o-2024-05-13"
{
if
name
==
"gpt-4o-2024-05-13"
{
return
3
,
true
return
3
,
true
...
...
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