From 8a441f84bfa7217875fc89adb63f62c1725b646d Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Thu, 14 Nov 2024 13:28:21 +0100 Subject: [PATCH] feat(ai): add ability to use float pricePerUnit 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. --- cmd/livepeer/starter/starter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/livepeer/starter/starter.go b/cmd/livepeer/starter/starter.go index e425a4250..4ee792d7b 100755 --- a/cmd/livepeer/starter/starter.go +++ b/cmd/livepeer/starter/starter.go @@ -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)