CryptAL commited on
Commit
2642418
·
1 Parent(s): a750c4b

Bumped Bittensor to newest version

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -15,6 +15,7 @@ import datetime
15
  import time
16
  import json
17
  import pandas as pd
 
18
  from dotenv import load_dotenv
19
  from huggingface_hub import HfApi
20
  from apscheduler.schedulers.background import BackgroundScheduler
@@ -147,9 +148,10 @@ def get_subnet_data(
147
  hex_data = commitment[list(commitment.keys())[0]][2:]
148
  chain_str = bytes.fromhex(hex_data).decode()
149
  block = metadata["block"]
150
- incentive = metagraph.incentive[uid].nan_to_num().item()
 
151
  emission = (
152
- metagraph.emission[uid].nan_to_num().item() * 20
153
  ) # convert to daily TAO
154
 
155
  model_data = None
@@ -200,11 +202,10 @@ def get_scores(
200
  data = json.loads(run.summary["original_format_json"])
201
  all_uid_data = data["uid_data"]
202
  timestamp = data["timestamp"]
203
-
204
  # Make sure runs are indeed in descending time order.
205
- assert (
206
- previous_timestamp is None or timestamp < previous_timestamp
207
- ), f"Timestamps are not in descending order: {timestamp} >= {previous_timestamp}"
208
  previous_timestamp = timestamp
209
 
210
  for uid in uids:
@@ -326,7 +327,6 @@ def main():
326
 
327
  model_data: List[ModelData] = get_subnet_data(subtensor, metagraph)
328
  model_data.sort(key=lambda x: x.incentive, reverse=True)
329
-
330
  vali_runs = get_wandb_runs(project=VALIDATOR_WANDB_PROJECT, filters={"config.type": "validator", "config.uid": 238})
331
 
332
  scores = get_scores([x.uid for x in model_data], vali_runs)
 
15
  import time
16
  import json
17
  import pandas as pd
18
+ import numpy as np
19
  from dotenv import load_dotenv
20
  from huggingface_hub import HfApi
21
  from apscheduler.schedulers.background import BackgroundScheduler
 
148
  hex_data = commitment[list(commitment.keys())[0]][2:]
149
  chain_str = bytes.fromhex(hex_data).decode()
150
  block = metadata["block"]
151
+
152
+ incentive = np.nan_to_num(metagraph.incentive[uid]).item()
153
  emission = (
154
+ np.nan_to_num(metagraph.emission[uid]).item() * 20
155
  ) # convert to daily TAO
156
 
157
  model_data = None
 
202
  data = json.loads(run.summary["original_format_json"])
203
  all_uid_data = data["uid_data"]
204
  timestamp = data["timestamp"]
 
205
  # Make sure runs are indeed in descending time order.
206
+ #assert (
207
+ #previous_timestamp is None or timestamp < previous_timestamp
208
+ #), f"Timestamps are not in descending order: {timestamp} >= {previous_timestamp}"
209
  previous_timestamp = timestamp
210
 
211
  for uid in uids:
 
327
 
328
  model_data: List[ModelData] = get_subnet_data(subtensor, metagraph)
329
  model_data.sort(key=lambda x: x.incentive, reverse=True)
 
330
  vali_runs = get_wandb_runs(project=VALIDATOR_WANDB_PROJECT, filters={"config.type": "validator", "config.uid": 238})
331
 
332
  scores = get_scores([x.uid for x in model_data], vali_runs)