Skip to content

Commit

Permalink
Merge pull request #27 from opentensor/mg-shrink-fix
Browse files Browse the repository at this point in the history
handle case where mg shrinks from previously stored chain state
  • Loading branch information
ifrit98 authored Oct 1, 2023
2 parents 7254b4a + c48e157 commit bec2654
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion prompting/validators/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def resync_metagraph(self: "validators.neuron.neuron"):
if len(self.hotkeys) < len(self.metagraph.hotkeys):
# Update the size of the moving average scores.
new_moving_average = torch.zeros((self.metagraph.n)).to(self.device)
new_moving_average[: len(self.hotkeys)] = self.moving_averaged_scores
min_len = min(len(self.hotkeys), len(self.moving_averaged_scores))
new_moving_average[:min_len] = self.moving_averaged_scores[:min_len]
self.moving_averaged_scores = new_moving_average

# Resize the gating model.
Expand Down

0 comments on commit bec2654

Please sign in to comment.