From c495baf13b3f8d68cdf43658edd860cd62bca317 Mon Sep 17 00:00:00 2001 From: pcarlson-foundry-digital Date: Thu, 9 Jan 2025 15:48:08 -0500 Subject: [PATCH] fix for uid error --- precog/validators/weight_setter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/precog/validators/weight_setter.py b/precog/validators/weight_setter.py index 0eff51e..8780f04 100755 --- a/precog/validators/weight_setter.py +++ b/precog/validators/weight_setter.py @@ -130,7 +130,14 @@ async def set_weights(self): self.current_block = func_with_retry(self.subtensor.get_current_block) except Exception as e: bt.logging.error(f"Failed to get current block with error {e}, skipping block update") + return + if self.blocks_since_last_update >= self.hyperparameters.weights_rate_limit: + for uid in self.available_uids: + if uid not in self.moving_average_scores: + bt.logging.debug(f"Initializing score for new UID: {uid}") + self.moving_average_scores[uid] = 0.0 + uids = array(self.available_uids) weights = [self.moving_average_scores[uid] for uid in self.available_uids] if not weights: