Browse Source

fix-3262

tags/v1.22.12.2^2
Gitea 3 years ago
parent
commit
4a5f9cd4c8
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      routers/repo/modelarts.go

+ 8
- 7
routers/repo/modelarts.go View File

@@ -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


Loading…
Cancel
Save