From 827df650a9cbc5783f245b2913e05a1a7212e1a6 Mon Sep 17 00:00:00 2001 From: Dmytro Bobrenko <17252809+dbobrenko@users.noreply.github.com> Date: Thu, 3 Jul 2025 11:10:48 +0000 Subject: [PATCH] Fix tests and old weight history format --- prompting/weight_setting/weight_setter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)