fix: Switch to channel-ratio

- Use channel ratios instead of group ratios in all applicable places
- Start using the lowest channel ratio of the specified channel's groups
This commit is contained in:
Laisky.Cai
2024-03-01 13:49:23 +00:00
parent ba827b95e3
commit dbe3930a8c
5 changed files with 24 additions and 8 deletions

View File

@@ -28,7 +28,7 @@ func RelayAudioHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatus
channelType := c.GetInt("channel")
channelId := c.GetInt("channel_id")
userId := c.GetInt("id")
group := c.GetString("group")
// group := c.GetString("group")
tokenName := c.GetString("token_name")
var ttsRequest openai.TextToSpeechRequest
@@ -47,7 +47,8 @@ func RelayAudioHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatus
}
modelRatio := common.GetModelRatio(audioModel)
groupRatio := common.GetGroupRatio(group)
// groupRatio := common.GetGroupRatio(group)
groupRatio := c.GetFloat64("channel_ratio")
ratio := modelRatio * groupRatio
var quota int
var preConsumedQuota int