Spaces:
Configuration error
Configuration error
Download memory.py from antonypamo/simbioII: direct link, hf CLI and curl.
- Browser
- Download file 264 Bytes
-
https://huggingface.co/spaces/antonypamo/simbioII/resolve/main/memory.py
- Command line
-
hf download hf://spaces/antonypamo/simbioII/memory.py
-
curl -L -o memory.py https://huggingface.co/spaces/antonypamo/simbioII/resolve/main/memory.py
264 Bytes
| import json, os | |
| class MemoryStore: | |
| def __init__(self, path): | |
| self.path = path | |
| if not os.path.exists(path): open(path, 'w').close() | |
| def add(self, record): | |
| with open(self.path, 'a') as f: | |
| f.write(json.dumps(record) + "\n") |