Spaces:
Runtime error
Runtime error
DEVICE = "cuda" if torch.cuda.is_available() else "cpu" # Removed for ZeroGPU compatibility (lazy check instead)
Browse files
main.py
CHANGED
|
@@ -33,7 +33,7 @@ except ImportError:
|
|
| 33 |
# ----------------------------------------------------------------------
|
| 34 |
# CONFIGURATION
|
| 35 |
# ----------------------------------------------------------------------
|
| 36 |
-
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 37 |
|
| 38 |
# Model options
|
| 39 |
MODEL_SIZE = 1024
|
|
@@ -1252,6 +1252,9 @@ if __name__ == "__main__":
|
|
| 1252 |
num_workers = max(1, min(NUM_WORKERS, total_cpus))
|
| 1253 |
|
| 1254 |
# Decide whether to use multiprocessing
|
|
|
|
|
|
|
|
|
|
| 1255 |
use_pool = USE_MULTIPROCESSING and DEVICE == "cpu" and total_cpus >= 4
|
| 1256 |
|
| 1257 |
if use_pool:
|
|
|
|
| 33 |
# ----------------------------------------------------------------------
|
| 34 |
# CONFIGURATION
|
| 35 |
# ----------------------------------------------------------------------
|
| 36 |
+
# DEVICE = "cuda" if torch.cuda.is_available() else "cpu" # Removed for ZeroGPU compatibility (lazy check instead)
|
| 37 |
|
| 38 |
# Model options
|
| 39 |
MODEL_SIZE = 1024
|
|
|
|
| 1252 |
num_workers = max(1, min(NUM_WORKERS, total_cpus))
|
| 1253 |
|
| 1254 |
# Decide whether to use multiprocessing
|
| 1255 |
+
# Local device check
|
| 1256 |
+
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 1257 |
+
|
| 1258 |
use_pool = USE_MULTIPROCESSING and DEVICE == "cpu" and total_cpus >= 4
|
| 1259 |
|
| 1260 |
if use_pool:
|