From fd0e82349020c892aad41b5bc42819b61f4c3181 Mon Sep 17 00:00:00 2001 From: tzwang Date: Tue, 25 Jun 2024 19:19:48 +0800 Subject: [PATCH] updated textinfer api Former-commit-id: d0c9203bfb6af1f141e9bf2468d35cc1ab642084 --- .../logic/inference/texttotextinferencelogic.go | 10 ++++++++++ 1 file changed, 10 insertions(+) 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, "")