Browse Source

show active

tags/v1.21.12.1
lewis 4 years ago
parent
commit
add02909d8
1 changed files with 12 additions and 9 deletions
  1. +12
    -9
      routers/repo/modelarts.go

+ 12
- 9
routers/repo/modelarts.go View File

@@ -75,13 +75,13 @@ func NotebookIndex(ctx *context.Context) {
pager.SetDefaultParams(ctx) pager.SetDefaultParams(ctx)
ctx.Data["Page"] = pager ctx.Data["Page"] = pager


ctx.Data["PageIsCloudBrain"] = true
ctx.Data["PageIsNotebook"] = true
ctx.Data["Tasks"] = ciTasks ctx.Data["Tasks"] = ciTasks
ctx.HTML(200, tplModelArtsNotebookIndex) ctx.HTML(200, tplModelArtsNotebookIndex)
} }


func NotebookNew(ctx *context.Context) { func NotebookNew(ctx *context.Context) {
ctx.Data["PageIsCloudBrain"] = true
ctx.Data["PageIsNotebook"] = true


t := time.Now() t := time.Now()
var jobName = cutString(ctx.User.Name, 5) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:] var jobName = cutString(ctx.User.Name, 5) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:]
@@ -102,7 +102,7 @@ func NotebookNew(ctx *context.Context) {
} }


func NotebookCreate(ctx *context.Context, form auth.CreateModelArtsNotebookForm) { func NotebookCreate(ctx *context.Context, form auth.CreateModelArtsNotebookForm) {
ctx.Data["PageIsCloudBrain"] = true
ctx.Data["PageIsNotebook"] = true
jobName := form.JobName jobName := form.JobName
uuid := form.Attachment uuid := form.Attachment
description := form.Description description := form.Description
@@ -117,7 +117,7 @@ func NotebookCreate(ctx *context.Context, form auth.CreateModelArtsNotebookForm)
} }


func NotebookShow(ctx *context.Context) { func NotebookShow(ctx *context.Context) {
ctx.Data["PageIsCloudBrain"] = true
ctx.Data["PageIsNotebook"] = true


var jobID = ctx.Params(":jobid") var jobID = ctx.Params(":jobid")
task, err := models.GetCloudbrainByJobID(jobID) task, err := models.GetCloudbrainByJobID(jobID)
@@ -280,13 +280,13 @@ func TrainJobIndex(ctx *context.Context) {
pager.SetDefaultParams(ctx) pager.SetDefaultParams(ctx)
ctx.Data["Page"] = pager ctx.Data["Page"] = pager


ctx.Data["PageIsCloudBrain"] = true
ctx.Data["PageIsTrainJob"] = true
ctx.Data["Tasks"] = tasks ctx.Data["Tasks"] = tasks
ctx.HTML(200, tplModelArtsTrainJobIndex) ctx.HTML(200, tplModelArtsTrainJobIndex)
} }


func TrainJobNew(ctx *context.Context) { func TrainJobNew(ctx *context.Context) {
ctx.Data["PageIsCloudBrain"] = true
ctx.Data["PageIsTrainJob"] = true


t := time.Now() t := time.Now()
var jobName = cutString(ctx.User.Name, 5) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:] var jobName = cutString(ctx.User.Name, 5) + t.Format("2006010215") + strconv.Itoa(int(t.Unix()))[5:]
@@ -327,11 +327,14 @@ func TrainJobNew(ctx *context.Context) {
} }
ctx.Data["flavor_infos"] = flavorInfos.Info ctx.Data["flavor_infos"] = flavorInfos.Info


outputObsPath := "/" + setting.Bucket + modelarts.JobPath + jobName + modelarts.OutputPath
ctx.Data["train_url"] = outputObsPath

ctx.HTML(200, tplModelArtsTrainJobNew) ctx.HTML(200, tplModelArtsTrainJobNew)
} }


func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) { func TrainJobCreate(ctx *context.Context, form auth.CreateModelArtsTrainJobForm) {
ctx.Data["PageIsCloudBrain"] = true
ctx.Data["PageIsTrainJob"] = true
jobName := form.JobName jobName := form.JobName
uuid := form.Attachment uuid := form.Attachment
description := form.Description description := form.Description
@@ -546,7 +549,7 @@ func paramCheckCreateTrainJob(form auth.CreateModelArtsTrainJobForm) error {
} }


func TrainJobShow(ctx *context.Context) { func TrainJobShow(ctx *context.Context) {
ctx.Data["PageIsCloudBrain"] = true
ctx.Data["PageIsTrainJob"] = true


var jobID = ctx.Params(":jobid") var jobID = ctx.Params(":jobid")
task, err := models.GetCloudbrainByJobID(jobID) task, err := models.GetCloudbrainByJobID(jobID)
@@ -592,7 +595,7 @@ func TrainJobShow(ctx *context.Context) {
} }


func TrainJobGetLog(ctx *context.Context) { func TrainJobGetLog(ctx *context.Context) {
ctx.Data["PageIsCloudBrain"] = true
ctx.Data["PageIsTrainJob"] = true


var jobID = ctx.Params(":jobid") var jobID = ctx.Params(":jobid")
resultLogFile, result, err := trainJobGetLog(ctx, jobID) resultLogFile, result, err := trainJobGetLog(ctx, jobID)


Loading…
Cancel
Save