harshagnihotri14 commited on
Commit
a13d626
·
verified ·
1 Parent(s): 430ede3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -6,10 +6,13 @@ import gc
6
  import psutil
7
  import time
8
 
9
- # Enable garbage collection and set deterministic behavior
10
  gc.enable()
11
- torch.backends.cudnn.benchmark = False if torch.cuda.is_available() else None
12
- torch.backends.cudnn.deterministic = True if torch.cuda.is_available() else None
 
 
 
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