Update delete_model_passthrough.py

This commit is contained in:
Isi
2025-08-28 18:39:08 +01:00
committed by GitHub
parent c00c936b72
commit fe6749102c
+2
View File
@@ -44,6 +44,7 @@ class DeleteModelPassthrough:
if not torch.cuda.is_available():
return "CUDA not available."
initial = torch.cuda.memory_allocated()
print(f"Initial GPU memory: {initial}")
try:
del model
@@ -54,6 +55,7 @@ class DeleteModelPassthrough:
print(f"Failed to delete model: {e}")
final = torch.cuda.memory_allocated()
print(f"Final GPU memory: {final}")
freed = max(0, initial - final)
print(f"GPU VRAM freed: {freed/1e9:.2f} GB")