@@ -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 { | ||||
@@ -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, | ||||
@@ -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, | |||||
}) | }) | ||||
} | } | ||||
@@ -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) | ||||