diff --git a/api/internal/logic/inference/texttotextinferencelogic.go b/api/internal/logic/inference/texttotextinferencelogic.go index 2974d834..58b3edc1 100644 --- a/api/internal/logic/inference/texttotextinferencelogic.go +++ b/api/internal/logic/inference/texttotextinferencelogic.go @@ -106,6 +106,16 @@ func (l *TextToTextInferenceLogic) TextToTextInference(req *types.TextToTextInfe cs = append(cs, s) } + if len(cs) == 0 { + clusterId := opt.AiClusterIds[0] + clusterName, _ := l.svcCtx.Scheduler.AiStorages.GetClusterNameById(opt.AiClusterIds[0]) + err := l.svcCtx.Scheduler.AiStorages.SaveAiTask(id, opt, adapterName, clusterId, clusterName, "", constants.Failed, "") + if err != nil { + return nil, err + } + l.svcCtx.Scheduler.AiStorages.AddNoticeInfo(opt.AdapterId, adapterName, "", "", opt.TaskName, "failed", "任务失败") + } + for _, c := range cs { clusterName, _ := l.svcCtx.Scheduler.AiStorages.GetClusterNameById(c.clusterId) err := l.svcCtx.Scheduler.AiStorages.SaveAiTask(id, opt, adapterName, c.clusterId, clusterName, "", constants.Saved, "")