Skip to content

Commit

Permalink
Fix garbage collection
Browse files Browse the repository at this point in the history
Do garbage collection after every task.
  • Loading branch information
McCloudS authored Jul 13, 2024
1 parent ddd786f commit 1fe9fa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 1fe9fa5

Please sign in to comment.