Skip to content

Commit

Permalink
fix: local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jarvis8x7b committed Oct 30, 2024
1 parent ece71e0 commit 54eb11f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion neurons/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ async def _load_state(self):

logger.success(f"Loaded validator state: {scores=}")
async with self._scores_alock:
# if metagraph has more hotkeys than scores, adjust length
if len(scores) < len(self.metagraph.hotkeys):
logger.warning(
"Scores state is less than current metagraph hotkeys length, adjusting length. This should only happen when subnet is not at max UIDs yet."
Expand All @@ -746,8 +747,10 @@ async def _load_state(self):
logger.info(
f"Load state: adjusted scores shape from {scores.shape} to {adjusted_scores.shape}"
)
self.scores = torch.clamp(adjusted_scores, 0.0)
else:
self.scores = torch.clamp(scores, 0.0)

self.scores = torch.clamp(adjusted_scores, 0.0)
_terminal_plot(
f"scores on load, block: {self.block}", self.scores.numpy()
)
Expand Down

0 comments on commit 54eb11f

Please sign in to comment.