Ashley Wright commited on
Commit
a2cb75e
1 Parent(s): e230d71

Move run path to env, fix string formatting

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -10,6 +10,7 @@ import gradio as gr
10
  wandb_api = wandb.Api()
11
 
12
  SOURCE_VALIDATOR_UID = int(os.environ["SOURCE_VALIDATOR_UID"])
 
13
 
14
 
15
  @dataclass
@@ -29,9 +30,11 @@ def is_valid_run(run: Run):
29
  if key not in run.config:
30
  return False
31
 
 
32
  validator_hotkey = run.config["hotkey"]
 
33
 
34
- signing_message = f"{run.config["uid"]}:{validator_hotkey}:{run.config["contest"]}"
35
 
36
  try:
37
  return Keypair(validator_hotkey).verify(signing_message, run.config["signature"])
@@ -44,7 +47,7 @@ def main():
44
  with demo:
45
  with gr.Accordion("Submission Leaderboard"):
46
  runs: Runs = wandb_api.runs(
47
- "wombo-ai/edge-maxxing-test-subnet",
48
  filters={"config.type": "validator", "config.uid": SOURCE_VALIDATOR_UID},
49
  order="-created_at",
50
  )
 
10
  wandb_api = wandb.Api()
11
 
12
  SOURCE_VALIDATOR_UID = int(os.environ["SOURCE_VALIDATOR_UID"])
13
+ WANDB_RUN_PATH = os.environ["WANDB_RUN_PATH"]
14
 
15
 
16
  @dataclass
 
30
  if key not in run.config:
31
  return False
32
 
33
+ uid = run.config["uid"]
34
  validator_hotkey = run.config["hotkey"]
35
+ contest_name = run.config["contest"]
36
 
37
+ signing_message = f"{uid}:{validator_hotkey}:{contest_name}"
38
 
39
  try:
40
  return Keypair(validator_hotkey).verify(signing_message, run.config["signature"])
 
47
  with demo:
48
  with gr.Accordion("Submission Leaderboard"):
49
  runs: Runs = wandb_api.runs(
50
+ WANDB_RUN_PATH,
51
  filters={"config.type": "validator", "config.uid": SOURCE_VALIDATOR_UID},
52
  order="-created_at",
53
  )