Download shared/utils/model_unload.py from 1ripon1/ColabWan: direct link, hf CLI and curl.
- Browser
- Download file 217 Bytes
-
https://huggingface.co/spaces/1ripon1/ColabWan/resolve/main/shared/utils/model_unload.py
- Command line
-
hf download hf://spaces/1ripon1/ColabWan/shared/utils/model_unload.py
-
curl -L -o model_unload.py https://huggingface.co/spaces/1ripon1/ColabWan/resolve/main/shared/utils/model_unload.py
217 Bytes
| import threading | |
| from contextlib import contextmanager | |
| _lock = threading.RLock() | |
| def model_unload_guard(): | |
| with _lock: | |
| yield | |
| def wait_for_model_unload(): | |
| with _lock: | |
| pass | |