|
|
|
@@ -460,18 +460,16 @@ func UpdateCompletionRatioByJSONString(jsonStr string) error { |
|
|
|
func GetCompletionRatio(name string) float64 { |
|
|
|
name = FormatMatchingModelName(name) |
|
|
|
|
|
|
|
// 优先查用户设置的值(completionRatioMap),再查硬编码默认值 |
|
|
|
if strings.Contains(name, "/") { |
|
|
|
if ratio, ok := completionRatioMap.Get(name); ok { |
|
|
|
return ratio |
|
|
|
} |
|
|
|
} |
|
|
|
hardCodedRatio, contain := getHardcodedCompletionModelRatio(name) |
|
|
|
if contain { |
|
|
|
return hardCodedRatio |
|
|
|
} |
|
|
|
if ratio, ok := completionRatioMap.Get(name); ok { |
|
|
|
return ratio |
|
|
|
} |
|
|
|
hardCodedRatio, _ := getHardcodedCompletionModelRatio(name) |
|
|
|
return hardCodedRatio |
|
|
|
} |
|
|
|
|
|
|
|
|