Browse Source

refresh ai center

tags/v1.22.6.2
lewis 3 years ago
parent
commit
8bf5b6898e
2 changed files with 19 additions and 2 deletions
  1. +17
    -1
      routers/api/v1/repo/modelarts.go
  2. +2
    -1
      templates/repo/grampus/trainjob/show.tmpl

+ 17
- 1
routers/api/v1/repo/modelarts.go View File

@@ -127,7 +127,8 @@ func GetModelArtsTrainJob(ctx *context.APIContext) {

func GetModelArtsTrainJobVersion(ctx *context.APIContext) {
var (
err error
err error
aiCenterName string
)

jobID := ctx.Params(":jobid")
@@ -210,6 +211,20 @@ func GetModelArtsTrainJobVersion(ctx *context.APIContext) {
job.EndTime = job.StartTime.Add(job.Duration)
}
job.CorrectCreateUnix()

if len(job.AiCenter) == 0 {
if len(result.JobInfo.Tasks) > 0 {
if len(result.JobInfo.Tasks[0].CenterID[0]) > 0 && len(result.JobInfo.Tasks[0].CenterName[0]) > 0 {
job.AiCenter = result.JobInfo.Tasks[0].CenterID[0] + "+" + result.JobInfo.Tasks[0].CenterName[0]
aiCenterName = result.JobInfo.Tasks[0].CenterName[0]
}
}
} else {
temp := strings.Split(job.AiCenter, "+")
if len(temp) > 1 {
aiCenterName = temp[1]
}
}
err = models.UpdateTrainJobVersion(job)
if err != nil {
log.Error("UpdateJob failed:", err)
@@ -220,6 +235,7 @@ func GetModelArtsTrainJobVersion(ctx *context.APIContext) {
"JobID": jobID,
"JobStatus": job.Status,
"JobDuration": job.TrainJobDuration,
"AiCenter": aiCenterName,
})

}


+ 2
- 1
templates/repo/grampus/trainjob/show.tmpl View File

@@ -430,7 +430,7 @@
</td>

<td class="ti-text-form-content">
<div class="text-span text-span-w">
<div class="text-span text-span-w" id="{{.VersionName}}-ai_center">
{{$.ai_center}}
</div>
</td>
@@ -679,6 +679,7 @@
// detail status and duration
$('#' + version_name + '-duration').text(data.JobDuration)
$('#' + version_name + '-status').text(data.JobStatus)
$('#' + version_name + '-ai_center').text(data.AiCenter)
loadLog(version_name)




Loading…
Cancel
Save