Spaces:
Running
Running
Commit
·
ea6faf1
1
Parent(s):
be63e0f
Sync metagraph first
Browse files- src/chain_data.py +3 -2
- src/wandb_data.py +3 -0
src/chain_data.py
CHANGED
@@ -6,6 +6,7 @@ from enum import Enum
|
|
6 |
from math import ceil
|
7 |
from typing import TypeAlias
|
8 |
|
|
|
9 |
from fiber.chain.commitments import _deserialize_commitment_field
|
10 |
from fiber.chain.interface import get_substrate
|
11 |
from fiber.chain.metagraph import Metagraph
|
@@ -64,7 +65,7 @@ UPDATED: dict[Key, int] = {}
|
|
64 |
UIDS_BY_HOTKEY: dict[Key, Uid] = {}
|
65 |
HOTKEYS_BY_UID: dict[Uid, Key] = {}
|
66 |
|
67 |
-
substrate = get_substrate()
|
68 |
metagraph = Metagraph(substrate, netuid=str(NET_UID), load_old_nodes=False)
|
69 |
|
70 |
|
@@ -193,8 +194,8 @@ def sync_metagraph():
|
|
193 |
|
194 |
try:
|
195 |
print("Syncing metagraph...")
|
196 |
-
block = substrate.get_block_number(None) # type: ignore
|
197 |
metagraph.sync_nodes()
|
|
|
198 |
|
199 |
for uid, node in enumerate(metagraph.nodes.values()):
|
200 |
UIDS_BY_HOTKEY[node.hotkey] = uid
|
|
|
6 |
from math import ceil
|
7 |
from typing import TypeAlias
|
8 |
|
9 |
+
from fiber import constants
|
10 |
from fiber.chain.commitments import _deserialize_commitment_field
|
11 |
from fiber.chain.interface import get_substrate
|
12 |
from fiber.chain.metagraph import Metagraph
|
|
|
65 |
UIDS_BY_HOTKEY: dict[Key, Uid] = {}
|
66 |
HOTKEYS_BY_UID: dict[Uid, Key] = {}
|
67 |
|
68 |
+
substrate = get_substrate(subtensor_address=constants.FINNEY_SUBTENSOR_ADDRESS)
|
69 |
metagraph = Metagraph(substrate, netuid=str(NET_UID), load_old_nodes=False)
|
70 |
|
71 |
|
|
|
194 |
|
195 |
try:
|
196 |
print("Syncing metagraph...")
|
|
|
197 |
metagraph.sync_nodes()
|
198 |
+
block = substrate.get_block_number(None) # type: ignore
|
199 |
|
200 |
for uid, node in enumerate(metagraph.nodes.values()):
|
201 |
UIDS_BY_HOTKEY[node.hotkey] = uid
|
src/wandb_data.py
CHANGED
@@ -201,6 +201,9 @@ def _add_runs(wandb_runs: list[wapi.Run]):
|
|
201 |
...
|
202 |
|
203 |
status = _status_from_run(wandb_run)
|
|
|
|
|
|
|
204 |
uid = int(wandb_run.config["uid"])
|
205 |
hotkey = wandb_run.config["hotkey"]
|
206 |
date = _date_from_run(wandb_run)
|
|
|
201 |
...
|
202 |
|
203 |
status = _status_from_run(wandb_run)
|
204 |
+
if status == BenchmarkStatus.FINISHED:
|
205 |
+
continue
|
206 |
+
|
207 |
uid = int(wandb_run.config["uid"])
|
208 |
hotkey = wandb_run.config["hotkey"]
|
209 |
date = _date_from_run(wandb_run)
|