Skip to content

Commit

Permalink
fix for uid error
Browse files Browse the repository at this point in the history
  • Loading branch information
peterc-yuma committed Jan 9, 2025
1 parent 38c53a8 commit c495baf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions precog/validators/weight_setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c495baf

Please sign in to comment.