ollama通过模型参数选择对应模型
This commit is contained in:
parent
b17df76df7
commit
3d9dea3ea7
|
|
@ -84,7 +84,7 @@ func WSReceiveMessageService(userID, sessionID int, channel string, msg proto.WS
|
|||
var resID uint
|
||||
//处理消息
|
||||
if model.Type == "ollama" {
|
||||
resErr, resID = ReceiveOllamaSession(userID, sessionID, channel, msg)
|
||||
resErr, resID = ReceiveOllamaSession(userID, sessionID, channel, msg, modelParam)
|
||||
} else if model.Type == "spark" {
|
||||
resErr, resID = ReceiveSparkSession(userID, sessionID, channel, msg, modelParam)
|
||||
} else {
|
||||
|
|
@ -93,7 +93,7 @@ func WSReceiveMessageService(userID, sessionID int, channel string, msg proto.WS
|
|||
return resErr, resID
|
||||
}
|
||||
|
||||
func ReceiveOllamaSession(userID, sessionID int, channel string, msg proto.WSMessageReq) (error, uint) {
|
||||
func ReceiveOllamaSession(userID, sessionID int, channel string, msg proto.WSMessageReq, modelParam proto.ModelParam) (error, uint) {
|
||||
var resErr error
|
||||
var resID uint
|
||||
var err error
|
||||
|
|
@ -109,7 +109,7 @@ func ReceiveOllamaSession(userID, sessionID int, channel string, msg proto.WSMes
|
|||
log.Println("actx has get will use:", len(actx))
|
||||
}
|
||||
req := &api.GenerateRequest{
|
||||
Model: "qwen2.5:0.5b",
|
||||
Model: modelParam.Model,
|
||||
Context: actx,
|
||||
Prompt: prompt,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue