Commit ccabfe56 by Calcium-Ion Committed by GitHub

Merge pull request #1264 from feitianbubu/pr/uniq-channel-models

fix: unique channel models
parents 3523aafe 9034b2c9
......@@ -2,6 +2,7 @@ package controller
import (
"fmt"
"github.com/samber/lo"
"net/http"
"one-api/common"
"one-api/constant"
......@@ -136,6 +137,9 @@ func init() {
adaptor.Init(meta)
channelId2Models[i] = adaptor.GetModelList()
}
openAIModels = lo.UniqBy(openAIModels, func(m dto.OpenAIModels) string {
return m.Id
})
}
func ListModels(c *gin.Context) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment