Skip to content

Commit

Permalink
fix: set default trainer only for local regressor
Browse files Browse the repository at this point in the history
Signed-off-by: Sunyanan Choochotkaew <[email protected]>
  • Loading branch information
sunya-ch committed Aug 21, 2024
1 parent d143b67 commit 414533c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ func createPowerModelEstimator(modelConfig *types.ModelConfig) (PowerModelInterf
} else {
featuresNames = modelConfig.ProcessFeatureNames
}
trainerName := modelConfig.TrainerName
if trainerName == "" {
trainerName = config.DefaultTrainerName
}
model := &regressor.Regressor{
ModelServerEndpoint: config.ModelServerEndpoint,
OutputType: modelConfig.ModelOutputType,
EnergySource: modelConfig.EnergySource,
TrainerName: modelConfig.TrainerName,
TrainerName: trainerName,
SelectFilter: modelConfig.SelectFilter,
ModelWeightsURL: modelConfig.InitModelURL,
ModelWeightsFilepath: modelConfig.InitModelFilepath,
Expand Down Expand Up @@ -206,9 +210,6 @@ func getPowerModelType(powerSourceTarget string) (modelType types.ModelType) {
// getPowerModelTrainerName return the trainer name for a given power source, such as platform or components power sources
func getPowerModelTrainerName(powerSourceTarget string) (trainerName string) {
trainerName = config.ModelConfigValues[getModelConfigKey(powerSourceTarget, config.FixedTrainerNameKey)]
if trainerName == "" {
trainerName = config.DefaultTrainerName
}
return
}

Expand Down

0 comments on commit 414533c

Please sign in to comment.