diff --git a/prompting/weight_setting/weight_setter.py b/prompting/weight_setting/weight_setter.py index 8cc7039c5..31f0eeb4a 100644 --- a/prompting/weight_setting/weight_setter.py +++ b/prompting/weight_setting/weight_setter.py @@ -132,7 +132,7 @@ async def _compute_avg_reward(self) -> npt.NDArray[np.float32]: # Accumulate rewards for each epoch only if hotkey was not changed for the given UID. for epoch_info in self.reward_history: for uid_str, info in epoch_info.items(): - if active_hotkeys[int(uid_str)] == info["hotkey"]: + if active_hotkeys[int(uid_str)] == info.get("hotkey"): accum[int(uid_str)] += float(info["reward"]) avg = accum / len(self.reward_history)