Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions prompting/base/miner.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ def run(self):
self.axon.start()

bt.logging.info(f"Miner starting at block: {self.block}")

last_update_block = 0
# This loop maintains the miner's operations until intentionally stopped.
try:
while not self.should_exit:
while (
self.block - self.metagraph.last_update[self.uid]
self.block - last_update_block
< self.config.neuron.epoch_length
):
# Wait before checking again.
Expand All @@ -121,6 +121,7 @@ def run(self):

# Sync metagraph and potentially set weights.
self.sync()
last_update_block = self.block
self.step += 1

# If someone intentionally stops the miner, it'll safely terminate operations.
Expand Down