Skip to content

Commit 64d67e7

Browse files
merge pre-staging, resolve conflicts
2 parents d31ec32 + 5bc2e3c commit 64d67e7

File tree

5 files changed

+8
-37
lines changed

5 files changed

+8
-37
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,12 @@ python -m pip install -e .
134134
---
135135
# Running
136136

137-
We encourage miners to use testnet as this gives you a risk-free playground before running on mainnet. If you require test tao, please reach out to steffen@opentensor.dev
137+
We encourage miners to use testnet as this gives you a risk-free playground before running on mainnet. If you require test tao, please reach out to brady@opentensor.dev
138138

139139
Prior to running a miner or validator, you must [create a wallet](https://github.com/opentensor/docs/blob/main/reference/btcli.md) and [register the wallet to a netuid](https://github.com/opentensor/docs/blob/main/subnetworks/registration.md). Once you have done so, you can run the miner and validator with the following commands.
140140

141+
For miners and validators running on mainnet we **strongly encourage** you to use a [local subtensor](https://github.com/opentensor/subtensor).
142+
141143

142144
```bash
143145
# To run the validator
@@ -162,8 +164,6 @@ python neurons/miners/BASE_MINER/miner.py
162164
```
163165
where `BASE_MINER` is [zephyr](https://huggingface.co/HuggingFaceH4/zephyr-7b-beta), which is a fine-tuned Mistral-7B, however you can choose any of the supplied models found in `neurons/miners`.
164166

165-
For users who are new to the Bittensor ecosystem, 'finney' is the recommended subtensor, but more advanced users are encouraged to run a subtensor locally for greater performance and stability.
166-
167167
</div>
168168

169169
---

prompting/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# DEALINGS IN THE SOFTWARE.
1717

1818
# Define the version of the template module.
19-
__version__ = "1.1.1"
19+
__version__ = "1.1.2"
2020
version_split = __version__.split(".")
2121
__spec_version__ = (
2222
(10000 * int(version_split[0]))

prompting/base/miner.py

-30
Original file line numberDiff line numberDiff line change
@@ -184,36 +184,6 @@ def __exit__(self, exc_type, exc_value, traceback):
184184
"""
185185
self.stop_run_thread()
186186

187-
def set_weights(self):
188-
"""
189-
Self-assigns a weight of 1 to the current miner (identified by its UID) and
190-
a weight of 0 to all other peers in the network. The weights determine the trust level the miner assigns to other nodes on the network.
191-
192-
Raises:
193-
Exception: If there's an error while setting weights, the exception is logged for diagnosis.
194-
"""
195-
try:
196-
# --- query the chain for the most current number of peers on the network
197-
chain_weights = torch.zeros(
198-
self.subtensor.subnetwork_n(netuid=self.metagraph.netuid)
199-
)
200-
chain_weights[self.uid] = 1
201-
202-
# --- Set weights.
203-
self.subtensor.set_weights(
204-
wallet=self.wallet,
205-
netuid=self.metagraph.netuid,
206-
uids=torch.arange(0, len(chain_weights)),
207-
weights=chain_weights.to("cpu"),
208-
wait_for_inclusion=False,
209-
version_key=self.spec_version,
210-
)
211-
212-
except Exception as e:
213-
bt.logging.error(f"Failed to set weights on chain with exception: { e }")
214-
215-
bt.logging.info(f"Set weights: {chain_weights}")
216-
217187
def resync_metagraph(self):
218188
"""Resyncs the metagraph and updates the hotkeys and moving averages based on the new metagraph."""
219189
bt.logging.info("resync_metagraph()")

prompting/base/neuron.py

+3
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ def should_set_weights(self) -> bool:
154154
if self.config.neuron.disable_set_weights:
155155
return False
156156

157+
if not self.metagraph.validator_permit[self.uid]:
158+
return False
159+
157160
# Define appropriate logic for when set weights.
158161
return (
159162
self.block - self.metagraph.last_update[self.uid]

prompting/base/prompting_miner.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,4 @@ def log_event(
190190

191191
def log_status(self):
192192
m = self.metagraph
193-
bt.logging.info(
194-
f"Miner running:: network: {self.subtensor.network} | block: {self.block} | step: {self.step} | uid: {self.uid} | last updated: {self.block-m.last_update[self.uid]} | trust: {m.trust[self.uid]:.3f} | emission {m.emission[self.uid]:.3f}"
195-
)
193+
bt.logging.info(f"Miner running:: network: {self.subtensor.network} | step: {self.step} | uid: {self.uid} | trust: {m.trust[self.uid]:.3f} | emission {m.emission[self.uid]:.3f}")

0 commit comments

Comments
 (0)