Skip to content

Commit 055503f

Browse files
committed
add some const
1 parent 1011905 commit 055503f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/localcontroller/managers/lifelonglearning/lifelonglearningjob.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ const (
6262
AnnotationsRoundsKey = "sedna.io/rounds"
6363
AnnotationsNumberOfSamplesKey = "sedna.io/number-of-samples"
6464
AnnotationsDataFileOfEvalKey = "sedna.io/data-file-of-eval"
65+
DataTypeInput = "input"
66+
DataTypeOutput = "output"
67+
NumOfSamples = "num_of_samples"
6568
)
6669

6770
// LifelongLearningJobManager defines lifelong-learning-job Manager
@@ -347,9 +350,8 @@ func (lm *Manager) triggerTrainTask(job *Job) (interface{}, bool, error) {
347350
var err error
348351
jobConfig := job.JobConfig
349352

350-
const numOfSamples = "num_of_samples"
351353
samples := map[string]interface{}{
352-
numOfSamples: len(jobConfig.DataSamples.TrainSamples),
354+
NumOfSamples: len(jobConfig.DataSamples.TrainSamples),
353355
}
354356

355357
isTrigger := jobConfig.TrainTrigger.Trigger(samples)
@@ -772,13 +774,13 @@ func (lm *Manager) getModelsFromJobConditions(jobConditions []sednav1.LLJobCondi
772774
continue
773775
}
774776

775-
if dataType == "input" {
777+
if dataType == DataTypeInput {
776778
if cond.Input == nil {
777779
continue
778780
}
779781

780782
return cond.Input.Models
781-
} else if dataType == "output" {
783+
} else if dataType == DataTypeOutput {
782784
if cond.Output == nil {
783785
continue
784786
}

0 commit comments

Comments
 (0)