Spaces:
Sleeping
Sleeping
Download shared_memory.py from Pasmada/evolution-sandbo: direct link, hf CLI and curl.
- Browser
- Download file 498 Bytes
-
https://huggingface.co/spaces/Pasmada/evolution-sandbo/resolve/main/shared_memory.py
- Command line
-
hf download hf://spaces/Pasmada/evolution-sandbo/shared_memory.py
-
curl -L -o shared_memory.py https://huggingface.co/spaces/Pasmada/evolution-sandbo/resolve/main/shared_memory.py
498 Bytes
| class MemoryStore: | |
| def __init__(self): | |
| self.records = {} | |
| self.score_history = {} | |
| def store(self, agent, expr, score): | |
| if agent not in self.records or self.records[agent]['score'] < score: | |
| self.records[agent] = {'expression': expr, 'score': score} | |
| if agent not in self.score_history: | |
| self.score_history[agent] = [] | |
| self.score_history[agent].append(score) | |
| def get(self, agent): | |
| return self.records.get(agent, None) |