Spaces:
Build error
Build error
Download modules/base_interface.py from lbdhr/Whisper-WebUI: direct link, hf CLI and curl.
- Browser
- Download file 531 Bytes
-
https://huggingface.co/spaces/lbdhr/Whisper-WebUI/resolve/d419ad4fbe338426d5dcee78abda1704701d623c/modules/base_interface.py
- Command line
-
hf download hf://spaces/lbdhr/Whisper-WebUI@d419ad4fbe338426d5dcee78abda1704701d623c/modules/base_interface.py
-
curl -L -o base_interface.py https://huggingface.co/spaces/lbdhr/Whisper-WebUI/resolve/d419ad4fbe338426d5dcee78abda1704701d623c/modules/base_interface.py
531 Bytes
| import os | |
| import torch | |
| from typing import List | |
| class BaseInterface: | |
| def __init__(self): | |
| pass | |
| def release_cuda_memory(): | |
| if torch.cuda.is_available(): | |
| torch.cuda.empty_cache() | |
| torch.cuda.reset_max_memory_allocated() | |
| def remove_input_files(file_paths: List[str]): | |
| if not file_paths: | |
| return | |
| for file_path in file_paths: | |
| if file_path and os.path.exists(file_path): | |
| os.remove(file_path) | |