|
|
@@ -5,7 +5,6 @@ import ( |
|
|
|
"code.gitea.io/gitea/services/cloudbrain/resource" |
|
|
|
"encoding/json" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"io" |
|
|
|
"io/ioutil" |
|
|
|
"net/http" |
|
|
@@ -320,24 +319,7 @@ func NotebookShow(ctx *context.Context) { |
|
|
|
if err == nil { |
|
|
|
task.User = user |
|
|
|
} |
|
|
|
if modelarts.FlavorInfos == nil { |
|
|
|
json.Unmarshal([]byte(setting.FlavorInfos), &modelarts.FlavorInfos) |
|
|
|
} |
|
|
|
|
|
|
|
findSpec := false |
|
|
|
if modelarts.FlavorInfos != nil { |
|
|
|
ctx.Data["resource_spec"] = modelarts.FlavorInfos.FlavorInfo[0].Desc |
|
|
|
for _, f := range modelarts.FlavorInfos.FlavorInfo { |
|
|
|
if fmt.Sprint(f.Value) == task.FlavorCode { |
|
|
|
ctx.Data["resource_spec"] = f.Desc |
|
|
|
findSpec = true |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
setShowSpecBySpecialPoolConfig(ctx, findSpec, task) |
|
|
|
|
|
|
|
prepareSpec4Show(ctx, task) |
|
|
|
if task.TrainJobDuration == "" { |
|
|
|
if task.Duration == 0 { |
|
|
|
var duration int64 |
|
|
@@ -1781,7 +1763,6 @@ func TrainJobShow(ctx *context.Context) { |
|
|
|
for i, task := range VersionListTasks { |
|
|
|
|
|
|
|
var parameters models.Parameters |
|
|
|
|
|
|
|
err := json.Unmarshal([]byte(VersionListTasks[i].Parameters), ¶meters) |
|
|
|
if err != nil { |
|
|
|
log.Error("Failed to Unmarshal Parameters: %s (%v)", VersionListTasks[i].Parameters, err) |
|
|
@@ -1802,6 +1783,14 @@ func TrainJobShow(ctx *context.Context) { |
|
|
|
datasetList = append(datasetList, GetCloudBrainDataSetInfo(task.Uuid, false)) |
|
|
|
VersionListTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) |
|
|
|
VersionListTasks[i].CanModify = cloudbrain.CanModifyJob(ctx, &task.Cloudbrain) |
|
|
|
|
|
|
|
//add spec |
|
|
|
s, err := resource.GetCloudbrainSpec(task.Cloudbrain.ID) |
|
|
|
if err != nil { |
|
|
|
log.Error("TrainJobShow GetCloudbrainSpec error:" + err.Error()) |
|
|
|
continue |
|
|
|
} |
|
|
|
VersionListTasks[i].Cloudbrain.Spec = s |
|
|
|
} |
|
|
|
|
|
|
|
pager := context.NewPagination(VersionListCount, setting.UI.IssuePagingNum, page, 5) |
|
|
@@ -2533,7 +2522,7 @@ func InferenceJobShow(ctx *context.Context) { |
|
|
|
} else { |
|
|
|
task.Parameters = "" |
|
|
|
} |
|
|
|
|
|
|
|
prepareSpec4Show(ctx, task) |
|
|
|
LabelName := strings.Fields(task.LabelName) |
|
|
|
ctx.Data["labelName"] = LabelName |
|
|
|
ctx.Data["jobID"] = jobID |
|
|
|