Skip to content

Commit

Permalink
feat(ai): enforce 'aiModels' flag requirement (#3032)
Browse files Browse the repository at this point in the history
This commit ensures that an error is thrown when users don't specify
the 'aiModels' flag but have the 'aiWorker' flag set.
  • Loading branch information
rickstaa authored Apr 24, 2024
1 parent ea82cde commit 93caa3b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/livepeer/starter/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func StartLivepeer(ctx context.Context, cfg LivepeerConfig) {
if *cfg.AIModels != "" {
configs, err := core.ParseAIModelConfigs(*cfg.AIModels)
if err != nil {
glog.Error("Error parsing -aiModels: %v", err)
glog.Errorf("Error parsing -aiModels: %v", err)
return
}

Expand Down Expand Up @@ -601,6 +601,9 @@ func StartLivepeer(ctx context.Context, cfg LivepeerConfig) {
glog.V(6).Infof("Capability %s (ID: %v) advertised with model constraint %s at price %d per %d unit", config.Pipeline, capability, config.ModelID, price.Num(), price.Denom())
}
}
} else {
glog.Error("The '-aiModels' flag was set, but no model configuration was provided. Please specify the model configuration using the '-aiModels' flag.")
return
}

defer func() {
Expand Down

0 comments on commit 93caa3b

Please sign in to comment.