Browse Source

过滤掉启动文件的前后空格。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.10.1^2
zouap 3 years ago
parent
commit
b7c78fffb6
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      routers/repo/aisafety.go

+ 3
- 0
routers/repo/aisafety.go View File

@@ -632,6 +632,7 @@ func AiSafetyCreateForPost(ctx *context.Context) {
}
}
BootFile := ctx.Query("boot_file")
BootFile = strings.TrimSpace(BootFile)
bootFileExist, err := ctx.Repo.FileExists(BootFile, cloudbrain.DefaultBranchName)
if err != nil || !bootFileExist {
log.Error("Get bootfile error:", err)
@@ -656,6 +657,7 @@ func AiSafetyCreateForPost(ctx *context.Context) {
func createForNPU(ctx *context.Context, jobName string) error {
VersionOutputPath := modelarts.GetOutputPathByCount(modelarts.TotalVersionCount)
BootFile := ctx.Query("boot_file")
BootFile = strings.TrimSpace(BootFile)
displayJobName := ctx.Query("display_job_name")
description := ctx.Query("description")

@@ -830,6 +832,7 @@ func createForNPU(ctx *context.Context, jobName string) error {

func createForGPU(ctx *context.Context, jobName string) error {
BootFile := ctx.Query("boot_file")
BootFile = strings.TrimSpace(BootFile)
displayJobName := ctx.Query("display_job_name")
description := ctx.Query("description")
image := strings.TrimSpace(ctx.Query("image"))


Loading…
Cancel
Save