Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
floaties (#4789)
Browse files Browse the repository at this point in the history
  • Loading branch information
klshuster committed Sep 16, 2022
1 parent 285f32a commit accbd2f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion projects/bb3/agents/opt_bb3_agent.py
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions projects/bb3/agents/utils.py
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/nightly/gpu/test_bb3.py
Expand Up @@ -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):
Expand Down

0 comments on commit accbd2f

Please sign in to comment.