Spaces:
Running
Running
| 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) | |