Download augmentoolkit/generation_functions/cleanup.py from Leon4gr45/agent-0: direct link, hf CLI and curl.
- Browser
- Download file 427 Bytes
-
https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/augmentoolkit/generation_functions/cleanup.py
- Command line
-
hf download hf://spaces/Leon4gr45/agent-0/augmentoolkit/generation_functions/cleanup.py
-
curl -L -o cleanup.py https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/augmentoolkit/generation_functions/cleanup.py
427 Bytes
| import os | |
| def cleanup_dir(output_dir): | |
| # Walk through directory and remove all .lock files | |
| for root, dirs, files in os.walk(output_dir): | |
| for file in files: | |
| if file.endswith(".lock"): | |
| lock_file = os.path.join(root, file) | |
| try: | |
| os.remove(lock_file) | |
| except OSError: | |
| pass # Ignore errors if file can't be removed | |