From d183804b136f94ada1dc3aa42e80191cbabd09af Mon Sep 17 00:00:00 2001 From: liuzx Date: Fri, 31 Dec 2021 14:27:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/repo/modelarts.go | 4 ++-- routers/routes/routes.go | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 67244a74c..109920e36 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -1852,7 +1852,7 @@ func inferenceJobErrorNewDataPrepare(ctx *context.Context, form auth.CreateModel 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 @@ -2002,7 +2002,7 @@ func ResultDownload(ctx *context.Context) { if err != nil { ctx.Data["error"] = err.Error() } - path := strings.TrimPrefix(path.Join(setting.TrainJobModelPath, task.JobName, modelarts.ResultPath, versionName, parentDir, fileName), "/") + path := strings.TrimPrefix(path.Join(setting.TrainJobModelPath, task.JobName, "result/", versionName, parentDir, fileName), "/") log.Info("Download path is:%s", path) url, err := storage.GetObsCreateSignedUrlByBucketAndKey(setting.Bucket, path) diff --git a/routers/routes/routes.go b/routers/routes/routes.go index a3926c78c..670679ff2 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -34,7 +34,6 @@ import ( "code.gitea.io/gitea/routers" "code.gitea.io/gitea/routers/admin" apiv1 "code.gitea.io/gitea/routers/api/v1" - apiv1repo "code.gitea.io/gitea/routers/api/v1/repo" "code.gitea.io/gitea/routers/dev" "code.gitea.io/gitea/routers/events" "code.gitea.io/gitea/routers/org" @@ -1027,10 +1026,6 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("/model_download", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.ModelDownload) m.Get("/create_version", cloudbrain.AdminOrJobCreaterRight, repo.TrainJobNewVersion) m.Post("/create_version", cloudbrain.AdminOrJobCreaterRight, bindIgnErr(auth.CreateModelArtsTrainJobForm{}), repo.TrainJobCreateVersion) - m.Get("/log", apiv1repo.TrainJobGetLog) - m.Post("/del_version", apiv1repo.DelTrainJobVersion) - m.Post("/stop_version", apiv1repo.StopTrainJobVersion) - m.Get("/model_list", apiv1repo.ModelList) }) m.Get("/create", reqRepoCloudBrainWriter, repo.TrainJobNew) m.Post("/create", reqRepoCloudBrainWriter, bindIgnErr(auth.CreateModelArtsTrainJobForm{}), repo.TrainJobCreate) @@ -1042,10 +1037,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("", reqRepoCloudBrainReader, repo.InferenceJobIndex) m.Group("/:jobid", func() { m.Get("", reqRepoCloudBrainReader, repo.InferenceJobShow) - m.Get("/log", apiv1repo.TrainJobGetLog) - m.Post("/del_version", apiv1repo.DelTrainJobVersion) - m.Post("/stop_version", apiv1repo.StopTrainJobVersion) - m.Get("/result_list", apiv1repo.ResultList) + m.Get("/result_download", reqRepoCloudBrainReader, repo.ResultDownload) m.Get("/downloadall", repo.DownloadMultiResultFile) }) m.Get("/create", reqRepoCloudBrainWriter, repo.InferenceJobNew)