Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,10 +6,13 @@ import gc
|
|
6 |
import psutil
|
7 |
import time
|
8 |
|
9 |
-
# Enable garbage collection
|
10 |
gc.enable()
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
13 |
|
14 |
# Global variables
|
15 |
model = None
|
|
|
6 |
import psutil
|
7 |
import time
|
8 |
|
9 |
+
# Enable garbage collection
|
10 |
gc.enable()
|
11 |
+
|
12 |
+
# Properly handle CUDA settings
|
13 |
+
if torch.cuda.is_available():
|
14 |
+
torch.backends.cudnn.benchmark = False
|
15 |
+
torch.backends.cudnn.deterministic = True
|
16 |
|
17 |
# Global variables
|
18 |
model = None
|