Spaces:
Sleeping
Sleeping
Update my_model/utilities.py
Browse files- my_model/utilities.py +3 -2
my_model/utilities.py
CHANGED
|
@@ -9,6 +9,7 @@ import matplotlib.pyplot as plt
|
|
| 9 |
from IPython import get_ipython
|
| 10 |
import sys
|
| 11 |
import gc
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
class VQADataProcessor:
|
|
@@ -302,9 +303,9 @@ def free_gpu_resources():
|
|
| 302 |
torch.cuda.empty_cache()
|
| 303 |
gc.collect()
|
| 304 |
|
| 305 |
-
|
| 306 |
except Exception as e:
|
| 307 |
-
|
| 308 |
|
| 309 |
|
| 310 |
|
|
|
|
| 9 |
from IPython import get_ipython
|
| 10 |
import sys
|
| 11 |
import gc
|
| 12 |
+
import streamlit as st
|
| 13 |
|
| 14 |
|
| 15 |
class VQADataProcessor:
|
|
|
|
| 303 |
torch.cuda.empty_cache()
|
| 304 |
gc.collect()
|
| 305 |
|
| 306 |
+
st.write("GPU memory has been cleared.")
|
| 307 |
except Exception as e:
|
| 308 |
+
st.write(f"Error occurred while clearing GPU memory")
|
| 309 |
|
| 310 |
|
| 311 |
|