diff --git a/routers/repo/aisafety.go b/routers/repo/aisafety.go index 8eb275411..7e62ae71f 100644 --- a/routers/repo/aisafety.go +++ b/routers/repo/aisafety.go @@ -31,6 +31,7 @@ import ( const ( tplModelSafetyTestCreateGpu = "repo/modelsafety/newgpu" tplModelSafetyTestCreateNpu = "repo/modelsafety/newnpu" + tplModelSafetyTestShow = "repo/modelsafety/show" ) func CloudBrainAiSafetyCreateTest(ctx *context.Context) { @@ -67,13 +68,16 @@ func CloudBrainAiSafetyCreateTest(ctx *context.Context) { } func GetAiSafetyTaskByJob(job *models.Cloudbrain) { - if job == nil { log.Error("GetCloudbrainByJobID failed") return } syncAiSafetyTaskStatus(job) +} +func GetAiSafetyTaskTmpl(ctx *context.Context) { + ctx.Data["id"] = ctx.Params(":jobid") + ctx.HTML(200, tplModelSafetyTestShow) } func GetAiSafetyTask(ctx *context.Context) { @@ -85,6 +89,8 @@ func GetAiSafetyTask(ctx *context.Context) { } syncAiSafetyTaskStatus(job) job, err = models.GetCloudbrainByJobIDWithDeleted(ID) + job.BenchmarkType = "CV" + job.BenchmarkTypeName = "Classification" ctx.JSON(200, job) } diff --git a/routers/routes/routes.go b/routers/routes/routes.go index e249fafbe..9959e98ff 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -1229,6 +1229,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/modelsafety", func() { m.Group("/:jobid", func() { + m.Get("/show", reqRepoCloudBrainWriter, repo.GetAiSafetyTaskTmpl) m.Get("", reqRepoCloudBrainWriter, repo.GetAiSafetyTask) m.Post("/stop", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.StopAiSafetyTask) m.Post("/del", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.DelAiSafetyTask)