From 29fbd12870d001de1e4f6c233d32c58e1dffd295 Mon Sep 17 00:00:00 2001 From: ckt1031 <65409152+ckt1031@users.noreply.github.com> Date: Wed, 15 Nov 2023 20:13:48 +0800 Subject: [PATCH] Refactored variable name from DalleGenerationImageAmountRatios to DalleGenerationImageAmounts --- common/model-ratio.go | 2 +- controller/relay-image.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/model-ratio.go b/common/model-ratio.go index 457e0013..204c1128 100644 --- a/common/model-ratio.go +++ b/common/model-ratio.go @@ -19,7 +19,7 @@ var DalleSizeRatios = map[string]map[string]float64{ } // 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-3": {1, 1}, // OpenAI allows n=1 currently. } diff --git a/controller/relay-image.go b/controller/relay-image.go index d97e5e38..02ffcfb3 100644 --- a/controller/relay-image.go +++ b/controller/relay-image.go @@ -15,12 +15,12 @@ import ( ) func isWithinRange(element string, value int) bool { - if _, ok := common.DalleGenerationImageAmountRatios[element]; !ok { + if _, ok := common.DalleGenerationImageAmounts[element]; !ok { return false } - min := common.DalleGenerationImageAmountRatios[element][0] - max := common.DalleGenerationImageAmountRatios[element][1] + min := common.DalleGenerationImageAmounts[element][0] + max := common.DalleGenerationImageAmounts[element][1] return value >= min && value <= max }