Check model existence before unloading
Add a check to ensure model exists before unloading.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
subgen_version = '2026.01.3'
|
||||
subgen_version = '2026.01.4'
|
||||
|
||||
"""
|
||||
ENVIRONMENT VARIABLES DOCUMENTATION
|
||||
@@ -797,9 +797,10 @@ def delete_model():
|
||||
global model
|
||||
if clear_vram_on_complete and task_queue.is_idle():
|
||||
logging.debug("Queue idle; clearing model from memory.")
|
||||
model.model.unload_model()
|
||||
del model
|
||||
model = None
|
||||
if model:
|
||||
model.model.unload_model()
|
||||
del model
|
||||
model = None
|
||||
if transcribe_device.lower() == 'cuda' and torch.cuda.is_available():
|
||||
torch.cuda.empty_cache()
|
||||
logging.debug("CUDA cache cleared.")
|
||||
|
||||
Reference in New Issue
Block a user