Browse Source

调整GPU训练任务的日志显示逻辑。#2706

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.8.2^2
zouap 3 years ago
parent
commit
fed4f0c4bc
2 changed files with 5 additions and 0 deletions
  1. +2
    -0
      routers/repo/cloudbrain.go
  2. +3
    -0
      templates/repo/cloudbrain/trainjob/show.tmpl

+ 2
- 0
routers/repo/cloudbrain.go View File

@@ -2895,6 +2895,7 @@ func GetLogFromModelDir(ctx *context.Context) {
}
startLine := ctx.QueryInt("startLine")
endLine := ctx.QueryInt("endLine")

re := ""
for _, file := range files {
if strings.HasSuffix(file.FileName, "log.txt") {
@@ -2905,6 +2906,7 @@ func GetLogFromModelDir(ctx *context.Context) {
r := bufio.NewReader(reader)
for i := 0; i < endLine; i++ {
line, error := r.ReadString('\n')
log.Info("line=" + line)
if error == io.EOF {
log.Info("read file completed.")
break


+ 3
- 0
templates/repo/cloudbrain/trainjob/show.tmpl View File

@@ -879,6 +879,9 @@
startLine=0;
}
let endLine = $('input[name=end_line]').val();
if(endLine==""){
endLine = 50;
}
$.get(`/${userName}/${repoPath}/cloudbrain/train-job/${jobID}/get_log?endLine=${endLine}&startLine=${startLine}`, (data) => {
$('input[name=end_line]').val(data.EndLine)
$('input[name=start_line]').val(data.StartLine)


Loading…
Cancel
Save