diff --git a/routers/repo/aisafety.go b/routers/repo/aisafety.go index 9bb4b9dd4..2bacc4c33 100644 --- a/routers/repo/aisafety.go +++ b/routers/repo/aisafety.go @@ -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"))