Spaces:
Build error
Build error
Update gen_images.py
Browse files- gen_images.py +1 -1
gen_images.py
CHANGED
|
@@ -103,7 +103,7 @@ def generate_images(
|
|
| 103 |
"""
|
| 104 |
|
| 105 |
print('Loading networks from "%s"...' % network_pkl)
|
| 106 |
-
device = torch.device('cuda')
|
| 107 |
with dnnlib.util.open_url(network_pkl) as f:
|
| 108 |
G = legacy.load_network_pkl(f)['G_ema'].to(device) # type: ignore
|
| 109 |
|
|
|
|
| 103 |
"""
|
| 104 |
|
| 105 |
print('Loading networks from "%s"...' % network_pkl)
|
| 106 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
| 107 |
with dnnlib.util.open_url(network_pkl) as f:
|
| 108 |
G = legacy.load_network_pkl(f)['G_ema'].to(device) # type: ignore
|
| 109 |
|