Spaces:
Build error
Build error
Download webui/utils/cache.py from chenzihong/GraphGen: direct link, hf CLI and curl.
- Browser
- Download file 507 Bytes
-
https://huggingface.co/spaces/chenzihong/GraphGen/resolve/bf63ef469b2be46b86f8091ceed5d403df09bbbf/webui/utils/cache.py
- Command line
-
hf download hf://spaces/chenzihong/GraphGen@bf63ef469b2be46b86f8091ceed5d403df09bbbf/webui/utils/cache.py
-
curl -L -o cache.py https://huggingface.co/spaces/chenzihong/GraphGen/resolve/bf63ef469b2be46b86f8091ceed5d403df09bbbf/webui/utils/cache.py
507 Bytes
| import os | |
| import shutil | |
| import uuid | |
| def setup_workspace(folder): | |
| request_id = str(uuid.uuid4()) | |
| os.makedirs(folder, exist_ok=True) | |
| working_dir = os.path.join(folder, request_id) | |
| os.makedirs(working_dir, exist_ok=True) | |
| log_dir = os.path.join(folder, "logs") | |
| os.makedirs(log_dir, exist_ok=True) | |
| log_file = os.path.join(log_dir, f"{request_id}.log") | |
| return log_file, working_dir | |
| def cleanup_workspace(folder): | |
| if os.path.exists(folder): | |
| shutil.rmtree(folder) | |