|
|
|
@@ -339,6 +339,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) |
|
|
|
engineID := form.EngineID |
|
|
|
bootFile := form.BootFile |
|
|
|
flavorCode := form.Flavor |
|
|
|
params := form.Params |
|
|
|
poolID := form.PoolID |
|
|
|
isSaveParam := form.IsSaveParam |
|
|
|
repo := ctx.Repo.Repository |
|
|
|
@@ -382,6 +383,24 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) |
|
|
|
|
|
|
|
//todo: del local code? |
|
|
|
|
|
|
|
var parameters models.Parameters |
|
|
|
param := make([]models.Parameter, 0) |
|
|
|
if len(params) != 0 { |
|
|
|
err := json.Unmarshal([]byte(params), ¶meters) |
|
|
|
if err != nil { |
|
|
|
log.Error("Failed to Unmarshal params: %s (%v)", params, err) |
|
|
|
ctx.RenderWithErr("运行参数错误", tplModelArtsTrainJobNew, &form) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
for _, parameter := range parameters.Parameter { |
|
|
|
param = append(param, models.Parameter{ |
|
|
|
Label: parameter.Label, |
|
|
|
Value: parameter.Value, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if isSaveParam == "on" { |
|
|
|
if form.ParameterTemplateName == "" { |
|
|
|
log.Error("ParameterTemplateName is empty") |
|
|
|
@@ -403,9 +422,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) |
|
|
|
EngineID: int64(engineID), |
|
|
|
LogUrl: logObsPath, |
|
|
|
PoolID: poolID, |
|
|
|
Parameter: []models.Parameter{ |
|
|
|
|
|
|
|
}, |
|
|
|
Parameter: param, |
|
|
|
}) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
@@ -428,6 +445,7 @@ func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) |
|
|
|
LogUrl: logObsPath, |
|
|
|
PoolID: poolID, |
|
|
|
Uuid: uuid, |
|
|
|
Parameters: param, |
|
|
|
} |
|
|
|
|
|
|
|
err := modelarts.GenerateTrainJob(ctx, req) |
|
|
|
|