Ashoka74 commited on
Commit
15a6fdb
ยท
verified ยท
1 Parent(s): 120221c

Update merged_files3.py

Browse files
Files changed (1) hide show
  1. merged_files3.py +9 -0
merged_files3.py CHANGED
@@ -73,6 +73,15 @@ import numpy as np
73
  import io
74
  import base64
75
 
 
 
 
 
 
 
 
 
 
76
 
77
  MAX_IMAGE_WIDTH = 2048
78
  IMAGE_FORMAT = "JPEG"
 
73
  import io
74
  import base64
75
 
76
+ if torch.cuda.is_available():
77
+ torch.backends.cuda.matmul.allow_tf32 = True
78
+ torch.backends.cudnn.allow_tf32 = True
79
+ # Set a smaller attention slice size for RTX 2070
80
+ torch.backends.cuda.max_split_size_mb = 256 # Reduced from 512 for better stability
81
+ device = torch.device('cuda')
82
+ else:
83
+ device = torch.device('cpu')
84
+
85
 
86
  MAX_IMAGE_WIDTH = 2048
87
  IMAGE_FORMAT = "JPEG"