Browse Source

fix-2050

tags/v1.22.5.2^2
liuzx 3 years ago
parent
commit
3c1d4508c7
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      routers/repo/modelarts.go

+ 4
- 4
routers/repo/modelarts.go View File

@@ -1471,8 +1471,8 @@ func obsMkdir(dir string) error {
}

func paramCheckCreateTrainJob(form auth.CreateModelArtsTrainJobForm) error {
if !strings.HasSuffix(form.BootFile, ".py") {
log.Error("the boot file(%s) must be a python file", form.BootFile)
if !strings.HasSuffix(strings.TrimSpace(form.BootFile), ".py") {
log.Error("the boot file(%s) must be a python file", strings.TrimSpace(form.BootFile))
return errors.New("启动文件必须是python文件")
}

@@ -1489,8 +1489,8 @@ func paramCheckCreateTrainJob(form auth.CreateModelArtsTrainJobForm) error {
}

func paramCheckCreateInferenceJob(form auth.CreateModelArtsInferenceJobForm) error {
if !strings.HasSuffix(form.BootFile, ".py") {
log.Error("the boot file(%s) must be a python file", form.BootFile)
if !strings.HasSuffix(strings.TrimSpace(form.BootFile), ".py") {
log.Error("the boot file(%s) must be a python file", strings.TrimSpace(form.BootFile))
return errors.New("启动文件必须是python文件")
}



Loading…
Cancel
Save