Fix garbage collection

Do garbage collection after every task.
This commit is contained in:
McCloudS
2024-07-13 13:21:43 -06:00
committed by GitHub
parent ddd786f457
commit 1fe9fa59f6

View File

@@ -504,11 +504,11 @@ def start_model():
model = stable_whisper.load_faster_whisper(whisper_model, download_root=model_location, device=transcribe_device, cpu_threads=whisper_threads, num_workers=concurrent_transcriptions, compute_type=compute_type)
def delete_model():
gc.collect()
if clear_vram_on_complete and task_queue.qsize() == 0:
global model
logging.debug("Queue is empty, clearing/releasing VRAM")
model = None
gc.collect()
def isAudioFileExtension(file_extension):
return file_extension.casefold() in \