Browse Source

Merge branch 'gpu-inference' of git.openi.org.cn:OpenI/aiforge into gpu-inference

pull/2494/head
zhoupzh 2 years ago
parent
commit
9d18d08424
4 changed files with 9 additions and 4 deletions
  1. +1
    -0
      modules/auth/cloudbrain.go
  2. +2
    -0
      modules/cloudbrain/cloudbrain.go
  3. +4
    -4
      routers/api/v1/repo/cloudbrain.go
  4. +2
    -0
      routers/repo/cloudbrain.go

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

@@ -69,6 +69,7 @@ type CreateCloudBrainInferencForm struct {
ModelName string `form:"model_name" binding:"Required"` ModelName string `form:"model_name" binding:"Required"`
ModelVersion string `form:"model_version" binding:"Required"` ModelVersion string `form:"model_version" binding:"Required"`
CkptName string `form:"ckpt_name" binding:"Required"` CkptName string `form:"ckpt_name" binding:"Required"`
LabelName string `form:"label_names" binding:"Required"`
} }


func (f *CreateCloudBrainForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { func (f *CreateCloudBrainForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {


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

@@ -78,6 +78,7 @@ type GenerateCloudBrainTaskReq struct {
ModelName string ModelName string
ModelVersion string ModelVersion string
CkptName string CkptName string
LabelName string
} }


func GetCloudbrainDebugCommand() string { func GetCloudbrainDebugCommand() string {
@@ -400,6 +401,7 @@ func GenerateTask(req GenerateCloudBrainTaskReq) error {
ModelVersion: req.ModelVersion, ModelVersion: req.ModelVersion,
CkptName: req.CkptName, CkptName: req.CkptName,
ResultUrl: req.ResultPath, ResultUrl: req.ResultPath,
LabelName: req.LabelName,
CreatedUnix: createTime, CreatedUnix: createTime,
UpdatedUnix: createTime, UpdatedUnix: createTime,
CommitID: req.CommitID, CommitID: req.CommitID,


+ 4
- 4
routers/api/v1/repo/cloudbrain.go View File

@@ -157,15 +157,15 @@ func DelCloudBrainJob(ctx *context.APIContext) {


if errStr != "" { if errStr != "" {
ctx.JSON(http.StatusOK, map[string]interface{}{ ctx.JSON(http.StatusOK, map[string]interface{}{
"message": ctx.Tr(errStr),
"Message": ctx.Tr(errStr),
"VersionName": "1", "VersionName": "1",
"code": 1,
"Code": 1,
}) })
} else { } else {
ctx.JSON(http.StatusOK, map[string]interface{}{ ctx.JSON(http.StatusOK, map[string]interface{}{
"message": "",
"Message": "",
"VersionName": "1", "VersionName": "1",
"code": 0,
"Code": 0,
}) })
} }




+ 2
- 0
routers/repo/cloudbrain.go View File

@@ -380,6 +380,7 @@ func CloudBrainInferenceJobCreate(ctx *context.Context, form auth.CreateCloudBra
codePath := setting.JobPath + jobName + cloudbrain.CodeMountPath codePath := setting.JobPath + jobName + cloudbrain.CodeMountPath
resourceSpecId := form.ResourceSpecId resourceSpecId := form.ResourceSpecId
branchName := form.BranchName branchName := form.BranchName
labelName := form.LabelName
repo := ctx.Repo.Repository repo := ctx.Repo.Repository


ckptUrl := setting.Attachment.Minio.RealPath + form.TrainUrl + form.CkptName ckptUrl := setting.Attachment.Minio.RealPath + form.TrainUrl + form.CkptName
@@ -475,6 +476,7 @@ func CloudBrainInferenceJobCreate(ctx *context.Context, form auth.CreateCloudBra
ModelVersion: form.ModelVersion, ModelVersion: form.ModelVersion,
CkptName: form.CkptName, CkptName: form.CkptName,
TrainUrl: form.TrainUrl, TrainUrl: form.TrainUrl,
LabelName: labelName,
} }


err = cloudbrain.GenerateTask(req) err = cloudbrain.GenerateTask(req)


Loading…
Cancel
Save