mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 09:16:36 +08:00
chore: update model mapping implementation for audio (#1932)
* fixed model mapping * chore: update implementation --------- Co-authored-by: JustSong <quanpengsong@gmail.com>
This commit is contained in:
parent
95e8c16338
commit
ff589b5e4a
@ -110,16 +110,9 @@ func RelayAudioHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatus
|
||||
}()
|
||||
|
||||
// map model name
|
||||
modelMapping := c.GetString(ctxkey.ModelMapping)
|
||||
if modelMapping != "" {
|
||||
modelMap := make(map[string]string)
|
||||
err := json.Unmarshal([]byte(modelMapping), &modelMap)
|
||||
if err != nil {
|
||||
return openai.ErrorWrapper(err, "unmarshal_model_mapping_failed", http.StatusInternalServerError)
|
||||
}
|
||||
if modelMap[audioModel] != "" {
|
||||
audioModel = modelMap[audioModel]
|
||||
}
|
||||
modelMapping := c.GetStringMapString(ctxkey.ModelMapping)
|
||||
if modelMapping != nil && modelMapping[audioModel] != "" {
|
||||
audioModel = modelMapping[audioModel]
|
||||
}
|
||||
|
||||
baseURL := channeltype.ChannelBaseURLs[channelType]
|
||||
|
Loading…
Reference in New Issue
Block a user