Browse Source

Merge branch 'pretrainmodel' of git.openi.org.cn:OpenI/aiforge into pretrainmodel

tags/v1.22.9.2^2
zhoupzh 3 years ago
parent
commit
50ac56e188
1 changed files with 12 additions and 2 deletions
  1. +12
    -2
      routers/repo/grampus.go

+ 12
- 2
routers/repo/grampus.go View File

@@ -255,6 +255,11 @@ func grampusParamCheckCreateTrainJob(form auth.CreateGrampusTrainJobForm) error

func GrampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrainJobForm) {
ctx.Data["IsCreate"] = true
grampusTrainJobGpuCreate(ctx, form)
}

func grampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrainJobForm) {

displayJobName := form.DisplayJobName
jobName := util.ConvertDisplayJobNameToJobName(displayJobName)
uuid := form.Attachment
@@ -483,9 +488,9 @@ func GrampusTrainJobVersionCreate(ctx *context.Context, form auth.CreateGrampusT
ctx.Data["IsCreate"] = false
computeResource := ctx.Query("compute_resource")
if computeResource == models.GPUResource {
GrampusTrainJobGpuCreate(ctx, form)
grampusTrainJobGpuCreate(ctx, form)
} else if computeResource == models.NPUResource {
GrampusTrainJobNpuCreate(ctx, form)
grampusTrainJobNpuCreate(ctx, form)
} else {
ctx.ServerError("resource error", errors.New("compute resource is not support"))
return
@@ -517,6 +522,11 @@ func checkSpecialPool(ctx *context.Context, resourceType string) string {

func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrainJobForm) {
ctx.Data["IsCreate"] = true
grampusTrainJobNpuCreate(ctx, form)
}

func grampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrainJobForm) {

displayJobName := form.DisplayJobName
jobName := util.ConvertDisplayJobNameToJobName(displayJobName)
uuid := form.Attachment


Loading…
Cancel
Save