feat: enhance model ratio lookup with case-insensitive and direct matching
This commit is contained in:
@@ -342,6 +342,12 @@ func UpdateCompletionRatioByJSONString(jsonStr string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetCompletionRatio(name string) float64 {
|
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") {
|
if strings.HasPrefix(name, "gpt-4-gizmo") {
|
||||||
name = "gpt-4-gizmo-*"
|
name = "gpt-4-gizmo-*"
|
||||||
}
|
}
|
||||||
@@ -404,8 +410,8 @@ func GetCompletionRatio(name string) float64 {
|
|||||||
return 4
|
return 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(name, "deepseek") {
|
if strings.HasPrefix(lowercaseName, "deepseek") {
|
||||||
if strings.Contains(name, "reasoner") {
|
if strings.HasSuffix(lowercaseName, "reasoner") || strings.HasSuffix(lowercaseName, "r1") {
|
||||||
return 4
|
return 4
|
||||||
}
|
}
|
||||||
return 2
|
return 2
|
||||||
|
|||||||
Reference in New Issue
Block a user