From 54e1badbff57e5589e99b4bab4eed4545528ec35 Mon Sep 17 00:00:00 2001 From: liuzx Date: Wed, 29 Dec 2021 16:48:58 +0800 Subject: [PATCH] update --- routers/api/v1/api.go | 8 +++++++- routers/api/v1/repo/modelarts.go | 1 - routers/repo/modelarts.go | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 868fa23c4..763ff11af 100755 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -887,7 +887,13 @@ func RegisterRoutes(m *macaron.Macaron) { }) }) m.Group("/inference-job", func() { - m.Get("/:jobid", repo.GetModelArtsInferenceJob) + m.Group("/:jobid", func() { + m.Get("", repo.GetModelArtsInferenceJob) + m.Get("/log", repo.TrainJobGetLog) + m.Post("/del_version", repo.DelTrainJobVersion) + m.Post("/stop_version", repo.StopTrainJobVersion) + m.Get("/model_list", repo.ModelList) + }) }) }, reqRepoReader(models.UnitTypeCloudBrain)) }, repoAssignment()) diff --git a/routers/api/v1/repo/modelarts.go b/routers/api/v1/repo/modelarts.go index fe1ac087a..bb651663a 100755 --- a/routers/api/v1/repo/modelarts.go +++ b/routers/api/v1/repo/modelarts.go @@ -141,7 +141,6 @@ func TrainJobGetLog(ctx *context.APIContext) { var jobID = ctx.Params(":jobid") var versionName = ctx.Query("version_name") - // var logFileName = ctx.Query("file_name") var baseLine = ctx.Query("base_line") var order = ctx.Query("order") var lines = ctx.Query("lines") diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index c2864d744..8759b441e 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -1795,7 +1795,7 @@ func inferenceJobNewDataPrepare(ctx *context.Context) error { var jobName = "inference" + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:] ctx.Data["job_name"] = jobName - attachs, err := models.GetModelArtsUserAttachments(ctx.User.ID) + attachs, err := models.GetModelArtsTrainAttachments(ctx.User.ID) if err != nil { ctx.ServerError("GetAllUserAttachments failed:", err) return err