Commit 97e51e44 by RedwindA

fix gizmo completion ratio

parent 50907a57
...@@ -414,7 +414,12 @@ func UpdateCompletionRatioByJSONString(jsonStr string) error { ...@@ -414,7 +414,12 @@ func UpdateCompletionRatioByJSONString(jsonStr string) error {
func GetCompletionRatio(name string) float64 { func GetCompletionRatio(name string) float64 {
CompletionRatioMutex.RLock() CompletionRatioMutex.RLock()
defer CompletionRatioMutex.RUnlock() defer CompletionRatioMutex.RUnlock()
if strings.HasPrefix(name, "gpt-4-gizmo") {
name = "gpt-4-gizmo-*"
}
if strings.HasPrefix(name, "gpt-4o-gizmo") {
name = "gpt-4o-gizmo-*"
}
if strings.Contains(name, "/") { if strings.Contains(name, "/") {
if ratio, ok := CompletionRatio[name]; ok { if ratio, ok := CompletionRatio[name]; ok {
return ratio return ratio
...@@ -432,12 +437,6 @@ func GetCompletionRatio(name string) float64 { ...@@ -432,12 +437,6 @@ 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-4-gizmo") {
name = "gpt-4-gizmo-*"
}
if strings.HasPrefix(name, "gpt-4o-gizmo") {
name = "gpt-4o-gizmo-*"
}
if strings.HasPrefix(name, "gpt-4") && !strings.HasSuffix(name, "-all") && !strings.HasSuffix(name, "-gizmo-*") { if strings.HasPrefix(name, "gpt-4") && !strings.HasSuffix(name, "-all") && !strings.HasSuffix(name, "-gizmo-*") {
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" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment