mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-21 07:26:47 +08:00
Refactored variable name from
DalleGenerationImageAmountRatios to DalleGenerationImageAmounts
This commit is contained in:
@@ -19,7 +19,7 @@ var DalleSizeRatios = map[string]map[string]float64{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Array in values, of maxmium and minimum
|
// Array in values, of maxmium and minimum
|
||||||
var DalleGenerationImageAmountRatios = map[string][2]int{
|
var DalleGenerationImageAmounts = map[string][2]int{
|
||||||
"dall-e-2": {1, 10},
|
"dall-e-2": {1, 10},
|
||||||
"dall-e-3": {1, 1}, // OpenAI allows n=1 currently.
|
"dall-e-3": {1, 1}, // OpenAI allows n=1 currently.
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func isWithinRange(element string, value int) bool {
|
func isWithinRange(element string, value int) bool {
|
||||||
if _, ok := common.DalleGenerationImageAmountRatios[element]; !ok {
|
if _, ok := common.DalleGenerationImageAmounts[element]; !ok {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
min := common.DalleGenerationImageAmountRatios[element][0]
|
min := common.DalleGenerationImageAmounts[element][0]
|
||||||
max := common.DalleGenerationImageAmountRatios[element][1]
|
max := common.DalleGenerationImageAmounts[element][1]
|
||||||
|
|
||||||
return value >= min && value <= max
|
return value >= min && value <= max
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user