From 7b3eb3182db511e0930207a96bd8b7f98b596d42 Mon Sep 17 00:00:00 2001 From: zouap Date: Mon, 17 Oct 2022 14:26:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=A5=E5=BF=97=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/api/v1/repo/cloudbrain.go | 45 ++++++++++++++++++++----------- routers/repo/aisafety.go | 1 - 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/routers/api/v1/repo/cloudbrain.go b/routers/api/v1/repo/cloudbrain.go index 6cf44b9d7..7640a9f85 100755 --- a/routers/api/v1/repo/cloudbrain.go +++ b/routers/api/v1/repo/cloudbrain.go @@ -393,19 +393,20 @@ func ModelSafetyGetLog(ctx *context.APIContext) { return } if job.JobType == string(models.JobTypeModelSafety) { - if job.Type == models.TypeCloudBrainOne { - result, err := cloudbrain.GetJob(job.JobID) - existStr := "" - if err == nil && result != nil { - jobRes, _ := models.ConvertToJobResultPayload(result.Payload) - taskRoles := jobRes.TaskRoles - taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) - existStr = taskRes.TaskStatuses[0].ExitDiagnostics - } - ctx.Data["existStr"] = existStr - log.Info("existStr=" + existStr) - CloudbrainGetLog(ctx) - } else if job.Type == models.TypeCloudBrainTwo { + // if job.Type == models.TypeCloudBrainOne { + // // result, err := cloudbrain.GetJob(job.JobID) + // // existStr := "" + // // if err == nil && result != nil { + // // jobRes, _ := models.ConvertToJobResultPayload(result.Payload) + // // taskRoles := jobRes.TaskRoles + // // taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) + // // existStr = taskRes.TaskStatuses[0].ExitDiagnostics + // // } + // // ctx.Data["existStr"] = existStr + // // log.Info("existStr=" + existStr) + // // CloudbrainGetLog(ctx) + // } else + if job.Type == models.TypeCloudBrainTwo { //TrainJobForModelConvertGetLog(ctx) var baseLine = ctx.Query("base_line") var order = ctx.Query("order") @@ -540,8 +541,22 @@ func CloudbrainGetLog(ctx *context.APIContext) { return } if job.JobType == string(models.JobTypeModelSafety) { - ModelSafetyGetLog(ctx) - return + if job.Type == models.TypeCloudBrainOne { + result, err := cloudbrain.GetJob(job.JobID) + existStr := "" + if err == nil && result != nil { + jobRes, _ := models.ConvertToJobResultPayload(result.Payload) + taskRoles := jobRes.TaskRoles + taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) + existStr = taskRes.TaskStatuses[0].ExitDiagnostics + } + ctx.Data["existStr"] = existStr + log.Info("existStr=" + existStr) + } else { + ModelSafetyGetLog(ctx) + return + } + } lines := ctx.QueryInt("lines") diff --git a/routers/repo/aisafety.go b/routers/repo/aisafety.go index fad950b6f..338c9c980 100644 --- a/routers/repo/aisafety.go +++ b/routers/repo/aisafety.go @@ -535,7 +535,6 @@ func AiSafetyCreateForGetGPU(ctx *context.Context) { } else { log.Info("The GPU WaitCount not get") } - ctx.HTML(200, tplModelSafetyTestCreateGpu) }