Browse Source

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

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.8.2^2
zouap 3 years ago
parent
commit
4484ed2a24
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      routers/api/v1/repo/cloudbrain.go

+ 2
- 2
routers/api/v1/repo/cloudbrain.go View File

@@ -463,9 +463,10 @@ func getLogFromModelDir(jobName string, startLine int, endLine int) map[string]i
defer reader.Close()
if err == nil {
r := bufio.NewReader(reader)
for i := 0; i <= endLine; i++ {
for i := 0; i < endLine; i++ {
line, error := r.ReadString('\n')
log.Info("line=" + line)
fileEndLine = i
if error == io.EOF {
log.Info("read file completed.")
break
@@ -474,7 +475,6 @@ func getLogFromModelDir(jobName string, startLine int, endLine int) map[string]i
log.Info("read file error." + error.Error())
break
}
fileEndLine = i
if error == nil {
if i >= startLine {
re = re + line


Loading…
Cancel
Save