Spaces:
Runtime error
Runtime error
Download crazy_functions/agent_fns/persistent.py from adminstr/gpt-academic: direct link, hf CLI and curl.
- Browser
- Download file 400 Bytes
-
https://huggingface.co/spaces/adminstr/gpt-academic/resolve/main/crazy_functions/agent_fns/persistent.py
- Command line
-
hf download hf://spaces/adminstr/gpt-academic/crazy_functions/agent_fns/persistent.py
-
curl -L -o persistent.py https://huggingface.co/spaces/adminstr/gpt-academic/resolve/main/crazy_functions/agent_fns/persistent.py
400 Bytes
| from toolbox import Singleton | |
| class GradioMultiuserManagerForPersistentClasses(): | |
| def __init__(self): | |
| self.mapping = {} | |
| def already_alive(self, key): | |
| return (key in self.mapping) and (self.mapping[key].is_alive()) | |
| def set(self, key, x): | |
| self.mapping[key] = x | |
| return self.mapping[key] | |
| def get(self, key): | |
| return self.mapping[key] | |