|
|
@@ -6,6 +6,7 @@ |
|
|
|
package repo |
|
|
|
|
|
|
|
import ( |
|
|
|
"code.gitea.io/gitea/modules/util" |
|
|
|
"net/http" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
@@ -106,7 +107,7 @@ func GetModelArtsTrainJobVersion(ctx *context.APIContext) { |
|
|
|
job.TrainJobDuration = result.TrainJobDuration |
|
|
|
|
|
|
|
if result.Duration != 0 { |
|
|
|
job.TrainJobDuration = addZero(result.Duration/3600000) + ":" + addZero(result.Duration%3600000/60000) + ":" + addZero(result.Duration%60000/1000) |
|
|
|
job.TrainJobDuration = util.AddZero(result.Duration/3600000) + ":" + util.AddZero(result.Duration%3600000/60000) + ":" + util.AddZero(result.Duration%60000/1000) |
|
|
|
|
|
|
|
} else { |
|
|
|
job.TrainJobDuration = "00:00:00" |
|
|
@@ -125,15 +126,6 @@ func GetModelArtsTrainJobVersion(ctx *context.APIContext) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func addZero(t int64) (m string) { |
|
|
|
if t < 10 { |
|
|
|
m = "0" + strconv.FormatInt(t, 10) |
|
|
|
return m |
|
|
|
} else { |
|
|
|
return strconv.FormatInt(t, 10) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func TrainJobGetLog(ctx *context.APIContext) { |
|
|
|
var ( |
|
|
|
err error |
|
|
|