Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions folding/validators/reward.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from collections import defaultdict
import time
import copy
from typing import List
from collections import defaultdict

import numpy as np
import bittensor as bt
Expand Down Expand Up @@ -150,6 +151,7 @@ async def get_energies(
unique_energies = set() # Track unique energy values

# Process responses until we get TOP_K valid non-duplicate ones or run out of responses
all_files = []
for i, (
reported_energy,
_,
Expand Down Expand Up @@ -200,11 +202,12 @@ async def get_energies(
)

# Add intermediate checkpoint files to files dictionary
checkpoint_files = {}
for (
checkpoint_num,
checkpoint_energy,
checkpoint_path,
) in evaluator.intermediate_checkpoint_files.items():
files[f"checkpoint_{checkpoint_num}"] = checkpoint_energy
checkpoint_files[f"checkpoint_{checkpoint_num}"] = checkpoint_path

is_valid: bool = median_energy != 0.0

Expand Down Expand Up @@ -247,6 +250,10 @@ async def get_energies(

processed_indices.append(i)

files_copy = copy.deepcopy(files)
files_copy.update(checkpoint_files)
all_files.append(files_copy)

except Exception as e:
logger.error(f"Failed to parse miner data for uid {uid} with error: {e}")
continue
Expand Down