-
Notifications
You must be signed in to change notification settings - Fork 175
Open
Description
- neurons/validator.py
42 def __init__(self, config=None):
43 super(Validator, self).__init__(config=config)
44
45 bt.logging.info("load_state()")
46 self.load_state()
- template/base/validator.py
69 # Init sync with the network. Updates the metagraph.
70 self.sync()
- template/base/validator.py
def save_state(self):
"""Saves the state of the validator to a file."""
bt.logging.info("Saving validator state.")
# Save the state of the validator to file.
np.savez(
self.config.neuron.full_path + "/state.npz",
step=self.step,
scores=self.scores,
hotkeys=self.hotkeys,
)
def load_state(self):
"""Loads the state of the validator from a file."""
bt.logging.info("Loading validator state.")
# Load the state of the validator from file.
state = np.load(self.config.neuron.full_path + "/state.npz")
self.step = state["step"]
self.scores = state["scores"]
self.hotkeys = state["hotkeys"]
load_state() in neurons/validator.py is not needed.
the state is cleared when sync() is called in template/base/validator.py
Metadata
Metadata
Assignees
Labels
No labels