|
|
@@ -105,6 +105,23 @@ func saveModelByParameters(jobId string, versionName string, name string, versio |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
func SaveNewNameModel(ctx *context.Context) { |
|
|
|
name := ctx.Query("Name") |
|
|
|
if name == "" { |
|
|
|
ctx.Error(500, fmt.Sprintf("name or version is null.")) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
aimodels := models.QueryModelByName(name, ctx.Repo.Repository.ID) |
|
|
|
if len(aimodels) > 0 { |
|
|
|
ctx.Error(500, ctx.Tr("repo.model_rename")) |
|
|
|
return |
|
|
|
} |
|
|
|
SaveModel(ctx) |
|
|
|
|
|
|
|
log.Info("save model end.") |
|
|
|
} |
|
|
|
|
|
|
|
func SaveModel(ctx *context.Context) { |
|
|
|
log.Info("save model start.") |
|
|
|
JobId := ctx.Query("JobId") |
|
|
|