mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-18 01:26:37 +08:00
fixed model mapping
This commit is contained in:
parent
6ab87f8a08
commit
343aac6326
@ -110,15 +110,10 @@ func RelayAudioHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatus
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
// map model name
|
// map model name
|
||||||
modelMapping := c.GetString(ctxkey.ModelMapping)
|
modelMapping := c.GetStringMapString(ctxkey.ModelMapping)
|
||||||
if modelMapping != "" {
|
if modelMapping != nil {
|
||||||
modelMap := make(map[string]string)
|
if modelMapping[audioModel] != "" {
|
||||||
err := json.Unmarshal([]byte(modelMapping), &modelMap)
|
audioModel = modelMapping[audioModel]
|
||||||
if err != nil {
|
|
||||||
return openai.ErrorWrapper(err, "unmarshal_model_mapping_failed", http.StatusInternalServerError)
|
|
||||||
}
|
|
||||||
if modelMap[audioModel] != "" {
|
|
||||||
audioModel = modelMap[audioModel]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user