diff --git a/projects/bb3/agents/opt_bb3_agent.py b/projects/bb3/agents/opt_bb3_agent.py index 247c821d648..09f1bca49ff 100644 --- a/projects/bb3/agents/opt_bb3_agent.py +++ b/projects/bb3/agents/opt_bb3_agent.py @@ -314,7 +314,7 @@ def get_opening_memories( opening_memories = None if memories: if isinstance(memories, dict): - opening_memories = memories + opening_memories = {mem: int(turns) for mem, turns in memories.items()} elif isinstance(memories, list): opening_memories = {} for mem in memories: diff --git a/projects/bb3/agents/utils.py b/projects/bb3/agents/utils.py index 7d54d234cb8..27345420b39 100644 --- a/projects/bb3/agents/utils.py +++ b/projects/bb3/agents/utils.py @@ -396,6 +396,7 @@ def get_available_memories( """ available_memory = [] for memory, turns_since_used in memories.items(): + turns_since_used = int(turns_since_used) # check if we should ignore in session memories if ignore_in_session_memories and memory in in_session_memories: continue diff --git a/tests/nightly/gpu/test_bb3.py b/tests/nightly/gpu/test_bb3.py index 9eb38657671..c74ffa59156 100644 --- a/tests/nightly/gpu/test_bb3.py +++ b/tests/nightly/gpu/test_bb3.py @@ -611,6 +611,8 @@ def test_softblocking(self): def test_memory_utils(self): memories = self.memories + # test that it works with floats as well + memories = {m: float(t) for m, t in memories.items()} decay_factor = 0.99 success = False for _ in range(10):