|
|
|
@@ -242,13 +242,6 @@ func GrampusTrainJobGpuCreate(ctx *context.Context, form auth.CreateGrampusTrain |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
errStr := checkSpecialPool(ctx, "GPU") |
|
|
|
if errStr != "" { |
|
|
|
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeGPU) |
|
|
|
ctx.RenderWithErr(errStr, tplGrampusTrainJobGPUNew, &form) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//check count limit |
|
|
|
count, err := models.GetGrampusCountByUserID(ctx.User.ID, string(models.JobTypeTrain), models.GPUResource) |
|
|
|
if err != nil { |
|
|
|
@@ -461,13 +454,6 @@ func GrampusTrainJobNpuCreate(ctx *context.Context, form auth.CreateGrampusTrain |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
errStr := checkSpecialPool(ctx, "NPU") |
|
|
|
if errStr != "" { |
|
|
|
grampusTrainJobNewDataPrepare(ctx, grampus.ProcessorTypeNPU) |
|
|
|
ctx.RenderWithErr(errStr, tplGrampusTrainJobGPUNew, &form) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//check count limit |
|
|
|
count, err := models.GetGrampusCountByUserID(ctx.User.ID, string(models.JobTypeTrain), models.NPUResource) |
|
|
|
if err != nil { |
|
|
|
@@ -732,6 +718,9 @@ func GrampusTrainJobShow(ctx *context.Context) { |
|
|
|
task.Status = grampus.TransTrainJobStatus(result.JobInfo.Status) |
|
|
|
if task.Status != result.JobInfo.Status || result.JobInfo.Status == models.GrampusStatusRunning { |
|
|
|
task.Duration = result.JobInfo.RunSec |
|
|
|
if task.Duration < 0 { |
|
|
|
task.Duration = 0 |
|
|
|
} |
|
|
|
task.TrainJobDuration = models.ConvertDurationToStr(task.Duration) |
|
|
|
|
|
|
|
if task.StartTime == 0 && result.JobInfo.StartedAt > 0 { |
|
|
|
|