Skip to content

Commit

Permalink
feat(ai): add ability to use float pricePerUnit (#3248)
Browse files Browse the repository at this point in the history
This commit gives orchestrators the ability to set the pricePerUnit as a float so that they do not have to rely on the pricePerPixel field.
  • Loading branch information
rickstaa authored Nov 14, 2024
1 parent b87c7c3 commit 5738a52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/livepeer/starter/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1316,8 +1316,8 @@ func StartLivepeer(ctx context.Context, cfg LivepeerConfig) {
pricePerUnit = pricePerUnitBase
currency = currencyBase
glog.Warningf("No 'pricePerUnit' specified for model '%v' in pipeline '%v'. Using default value from `-pricePerUnit`: %v", config.ModelID, config.Pipeline, *cfg.PricePerUnit)
} else if !pricePerUnit.IsInt() || pricePerUnit.Sign() <= 0 {
panic(fmt.Errorf("'pricePerUnit' value specified for model '%v' in pipeline '%v' must be a valid positive integer, provided %v", config.ModelID, config.Pipeline, config.PricePerUnit))
} else if pricePerUnit.Sign() <= 0 {
panic(fmt.Errorf("'pricePerUnit' value specified for model '%v' in pipeline '%v' must be a valid positive number, provided %v", config.ModelID, config.Pipeline, config.PricePerUnit))
}

pricePerPixel := new(big.Rat).Quo(pricePerUnit, pixelsPerUnit)
Expand Down

0 comments on commit 5738a52

Please sign in to comment.