Skip to content

Commit 2c1060e

Browse files
Merge pull request #271 from macrocosm-os/staging
Staging
2 parents 664dc29 + 2aa42ad commit 2c1060e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

folding/base/miner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(self, config=None):
5353
)
5454

5555
# The axon handles request processing, allowing validators to send this miner requests.
56-
self.axon = bt.axon(wallet=self.wallet, config=self.config)
56+
self.axon = bt.axon(wallet=self.wallet, config=self.config, port=self.config.axon.port)
5757

5858
# Attach determiners which functions are called when servicing a request.
5959
logger.info(f"Attaching forward function to miner axon.")

folding/base/validator.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(self, config=None):
7171

7272
# Serve axon to enable external connections.
7373
if not self.config.neuron.axon_off:
74-
self.axon = bt.axon(wallet=self.wallet, config=self.config)
74+
self.axon = bt.axon(wallet=self.wallet, config=self.config, port=self.config.axon.port)
7575
self._serve_axon()
7676

7777
else:
@@ -132,17 +132,17 @@ def set_weights(self):
132132

133133
# Calculate the average reward for each uid across non-zero values.
134134
# Replace any NaN values with 0.
135-
raw_weights = torch.nn.functional.normalize(self.scores, p=1, dim=0)
135+
raw_weights = torch.nn.functional.normalize(self.scores, p=1, dim=0).to("cpu").numpy()
136136

137137
logger.debug("raw_weights", raw_weights)
138-
logger.debug("raw_weight_uids", self.metagraph.uids.to("cpu"))
138+
logger.debug("raw_weight_uids", self.metagraph.uids)
139139
# Process the raw weights to final_weights via subtensor limitations.
140140
(
141141
processed_weight_uids,
142142
processed_weights,
143143
) = bt.utils.weight_utils.process_weights_for_netuid(
144-
uids=self.metagraph.uids.to("cpu"),
145-
weights=raw_weights.to("cpu"),
144+
uids=self.metagraph.uids,
145+
weights=raw_weights,
146146
netuid=self.config.netuid,
147147
subtensor=self.subtensor,
148148
metagraph=self.metagraph,

folding/validators/forward.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ async def run_step(
7979
md_inputs=protein.md_inputs,
8080
pdb_contents=protein.pdb_contents,
8181
system_config=system_config,
82-
best_submitted_energy=best_submitted_energy,
82+
best_submitted_energy= 0 if np.isinf(best_submitted_energy) else best_submitted_energy,
8383
)
8484

8585
# Make calls to the network with the prompt - this is synchronous.

0 commit comments

Comments
 (0)