Spaces:
Runtime error
Runtime error
Download rtm_memory.py from bobrod20/rtm-generator: direct link, hf CLI and curl.
- Browser
- Download file 668 Bytes
-
https://huggingface.co/spaces/bobrod20/rtm-generator/resolve/main/rtm_memory.py
- Command line
-
hf download hf://spaces/bobrod20/rtm-generator/rtm_memory.py
-
curl -L -o rtm_memory.py https://huggingface.co/spaces/bobrod20/rtm-generator/resolve/main/rtm_memory.py
668 Bytes
| import os | |
| import json | |
| def get_rtm_memory(workspace): | |
| filename = f"rtms_{workspace}.json" | |
| if os.path.exists(filename): | |
| with open(filename, "r") as f: | |
| return json.load(f) | |
| return {} | |
| def save_rtm_report(workspace, company, report): | |
| filename = f"rtms_{workspace}.json" | |
| data = get_rtm_memory(workspace) | |
| data[company] = report | |
| with open(filename, "w") as f: | |
| json.dump(data, f) | |
| def remove_rtm_report(workspace, company): | |
| filename = f"rtms_{workspace}.json" | |
| data = get_rtm_memory(workspace) | |
| if company in data: | |
| del data[company] | |
| with open(filename, "w") as f: | |
| json.dump(data, f) |