diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 9b987b440..e1d79ecbd 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -220,17 +220,18 @@ func Notebook2Create(ctx *context.Context, form auth.CreateModelArtsNotebookForm } var datasetInfos map[string]models.DatasetInfo + var attachSize int if uuid != "" { datasetInfos, _, err = models.GetDatasetInfo(uuid) for _, infos := range datasetInfos { - if infos.Size > int(setting.DebugAttachSize * 1024 * 1024 * 1024) { - log.Error("The DatasetSize exceeds the limit (%d)", int(setting.DebugAttachSize)) //GB - notebookNewDataPrepare(ctx) - ctx.RenderWithErr(ctx.Tr("cloudbrain.error.debug_datasetsize"), tplModelArtsNotebookNew, &form) - return - } + attachSize += infos.Size + } + if attachSize > int(setting.DebugAttachSize * 1024 * 1024 * 1024) { + log.Error("The DatasetSize exceeds the limit (%d)", int(setting.DebugAttachSize)) //GB + notebookNewDataPrepare(ctx) + ctx.RenderWithErr(ctx.Tr("cloudbrain.error.debug_datasetsize"), tplModelArtsNotebookNew, &form) + return } - } var aiCenterCode = models.AICenterOfCloudBrainTwo