Spaces:
Build error
Build error
Update roop/globals.py
Browse files- roop/globals.py +8 -0
roop/globals.py
CHANGED
@@ -1,5 +1,13 @@
|
|
1 |
from typing import List
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
source_path = None
|
4 |
target_path = None
|
5 |
output_path = None
|
|
|
1 |
from typing import List
|
2 |
|
3 |
+
import torch # Import PyTorch to check for GPU availability
|
4 |
+
|
5 |
+
# Check if GPU is available and set the device accordingly
|
6 |
+
if torch.cuda.is_available():
|
7 |
+
device = torch.device("cuda")
|
8 |
+
else:
|
9 |
+
device = torch.device("cpu")
|
10 |
+
|
11 |
source_path = None
|
12 |
target_path = None
|
13 |
output_path = None
|