Skip to content

Commit

Permalink
feat: enhance model ratio lookup with case-insensitive and direct mat…
Browse files Browse the repository at this point in the history
…ching
  • Loading branch information
Calcium-Ion committed Jan 26, 2025
1 parent 15918b2 commit 2aca637
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions common/model-ratio.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ func UpdateCompletionRatioByJSONString(jsonStr string) error {
}

func GetCompletionRatio(name string) float64 {
if strings.Contains(name, "/") {
if ratio, ok := CompletionRatio[name]; ok {
return ratio
}
}
lowercaseName := strings.ToLower(name)
if strings.HasPrefix(name, "gpt-4-gizmo") {
name = "gpt-4-gizmo-*"
}
Expand Down Expand Up @@ -404,8 +410,8 @@ func GetCompletionRatio(name string) float64 {
return 4
}
}
if strings.HasPrefix(name, "deepseek") {
if strings.Contains(name, "reasoner") {
if strings.HasPrefix(lowercaseName, "deepseek") {
if strings.HasSuffix(lowercaseName, "reasoner") || strings.HasSuffix(lowercaseName, "r1") {
return 4
}
return 2
Expand Down

0 comments on commit 2aca637

Please sign in to comment.