|
|
|
@@ -28,7 +28,7 @@ const ( |
|
|
|
MODEL_NOT_LATEST = 0 |
|
|
|
) |
|
|
|
|
|
|
|
func saveModelByParameters(jobId string, versionName string, name string, version string, label string, description string, ctx *context.Context) error { |
|
|
|
func saveModelByParameters(jobId string, versionName string, name string, version string, label string, description string, engine int, ctx *context.Context) error { |
|
|
|
aiTask, err := models.GetCloudbrainByJobIDAndVersionName(jobId, versionName) |
|
|
|
if err != nil { |
|
|
|
aiTask, err = models.GetRepoCloudBrainByJobID(ctx.Repo.Repository.ID, jobId) |
|
|
|
@@ -153,8 +153,9 @@ func SaveModel(ctx *context.Context) { |
|
|
|
version := ctx.Query("Version") |
|
|
|
label := ctx.Query("Label") |
|
|
|
description := ctx.Query("Description") |
|
|
|
engine := ctx.QueryInt("Engine") |
|
|
|
trainTaskCreate := ctx.QueryBool("trainTaskCreate") |
|
|
|
|
|
|
|
log.Info("engine=" + fmt.Sprint(engine)) |
|
|
|
if !trainTaskCreate { |
|
|
|
if !ctx.Repo.CanWrite(models.UnitTypeModelManage) { |
|
|
|
//ctx.NotFound(ctx.Req.URL.RequestURI(), nil) |
|
|
|
@@ -173,7 +174,7 @@ func SaveModel(ctx *context.Context) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
err := saveModelByParameters(JobId, VersionName, name, version, label, description, ctx) |
|
|
|
err := saveModelByParameters(JobId, VersionName, name, version, label, description, engine, ctx) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
log.Info("save model error." + err.Error()) |
|
|
|
|