Download common/tmp_dir.py from hhz520/webchat: direct link, hf CLI and curl.
- Browser
- Download file 406 Bytes
-
https://huggingface.co/spaces/hhz520/webchat/resolve/main/common/tmp_dir.py
- Command line
-
hf download hf://spaces/hhz520/webchat/common/tmp_dir.py
-
curl -L -o tmp_dir.py https://huggingface.co/spaces/hhz520/webchat/resolve/main/common/tmp_dir.py
406 Bytes
| import os | |
| import pathlib | |
| from config import conf | |
| class TmpDir(object): | |
| """A temporary directory that is deleted when the object is destroyed.""" | |
| tmpFilePath = pathlib.Path("./tmp/") | |
| def __init__(self): | |
| pathExists = os.path.exists(self.tmpFilePath) | |
| if not pathExists: | |
| os.makedirs(self.tmpFilePath) | |
| def path(self): | |
| return str(self.tmpFilePath) + "/" | |