Whisper-WebUI / modules /base_interface.py
jhj0517
fix NoneType error
983803f
raw
history blame
531 Bytes
import os
import torch
from typing import List
class BaseInterface:
def __init__(self):
pass
@staticmethod
def release_cuda_memory():
if torch.cuda.is_available():
torch.cuda.empty_cache()
torch.cuda.reset_max_memory_allocated()
@staticmethod
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)