Browse Source

#1852

update
tags/v1.22.4.1^2
chenyifan01 3 years ago
parent
commit
d479fe8f1d
3 changed files with 10 additions and 1 deletions
  1. +4
    -1
      models/cloudbrain.go
  2. +1
    -0
      modules/cloudbrain/cloudbrain.go
  3. +5
    -0
      modules/modelarts/modelarts.go

+ 4
- 1
models/cloudbrain.go View File

@@ -1353,8 +1353,11 @@ func CloudbrainsVersionList(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int, e
}

func CreateCloudbrain(cloudbrain *Cloudbrain) (err error) {
sess := x.NewSession()
defer sess.Close()

cloudbrain.TrainJobDuration = DURATION_STR_ZERO
if _, err = x.Insert(cloudbrain); err != nil {
if _, err = sess.NoAutoTime().Insert(cloudbrain); err != nil {
return err
}
return nil


+ 1
- 0
modules/cloudbrain/cloudbrain.go View File

@@ -297,6 +297,7 @@ func GenerateTask(ctx *context.Context, displayJobName, jobName, image, command,
DatasetName: datasetName,
Parameters: params,
CreatedUnix: createTime,
UpdatedUnix: createTime,
})

if err != nil {


+ 5
- 0
modules/modelarts/modelarts.go View File

@@ -238,6 +238,7 @@ func GenerateTask(ctx *context.Context, jobName, uuid, description, flavor strin
Uuid: uuid,
ComputeResource: models.NPUResource,
CreatedUnix: createTime,
UpdatedUnix: createTime,
})

if err != nil {
@@ -292,6 +293,7 @@ func GenerateNotebook2(ctx *context.Context, displayJobName, jobName, uuid, desc
Image: imageName,
Description: description,
CreatedUnix: createTime,
UpdatedUnix: createTime,
})

if err != nil {
@@ -370,6 +372,7 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error
VersionCount: req.VersionCount,
TotalVersionCount: req.TotalVersionCount,
CreatedUnix: createTime,
UpdatedUnix: createTime,
})

if err != nil {
@@ -459,6 +462,7 @@ func GenerateTrainJobVersion(ctx *context.Context, req *GenerateTrainJobReq, job
TotalVersionCount: VersionTaskList[0].TotalVersionCount + 1,
VersionCount: VersionListCount + 1,
CreatedUnix: createTime,
UpdatedUnix: createTime,
})
if err != nil {
log.Error("CreateCloudbrain(%s) failed:%v", req.JobName, err.Error())
@@ -601,6 +605,7 @@ func GenerateInferenceJob(ctx *context.Context, req *GenerateInferenceJobReq) (e
CkptName: req.CkptName,
ResultUrl: req.ResultUrl,
CreatedUnix: createTime,
UpdatedUnix: createTime,
})

if err != nil {


Loading…
Cancel
Save