Browse Source

Merge pull request 'fix-2050' (#2173) from fix-2050 into V20220601

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/2173
Reviewed-by: lewis <747342561@qq.com>
tags/v1.22.5.2^2
lewis 3 years ago
parent
commit
7840ebb0d5
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