From 4a5f9cd4c84336477da832cf669b2ea32bb8ac13 Mon Sep 17 00:00:00 2001 From: Gitea Date: Thu, 8 Dec 2022 09:20:19 +0800 Subject: [PATCH] fix-3262 --- routers/repo/modelarts.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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