Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -27,21 +27,6 @@ args = parser.parse_args()
|
|
27 |
|
28 |
# Use the original GPU ID throughout the entire code for consistency
|
29 |
GPU_ID = args.gpu
|
30 |
-
|
31 |
-
# Set environment variables - this used to remap the GPU, but we're removing this for consistency
|
32 |
-
# Instead, we'll pass the original GPU ID to all commands
|
33 |
-
# os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu) # Commented out to ensure consistent GPU ID usage
|
34 |
-
|
35 |
-
# Check if CUDA is available
|
36 |
-
CUDA_AVAILABLE = torch.cuda.is_available()
|
37 |
-
if CUDA_AVAILABLE:
|
38 |
-
GPU_COUNT = torch.cuda.device_count()
|
39 |
-
GPU_NAMES = [f"{i}: {torch.cuda.get_device_name(i)}" for i in range(GPU_COUNT)]
|
40 |
-
else:
|
41 |
-
GPU_COUNT = 0
|
42 |
-
GPU_NAMES = ["CPU (CUDA not available)"]
|
43 |
-
GPU_ID = "CPU"
|
44 |
-
|
45 |
DEFAULT_MODEL_PATH = args.model_path
|
46 |
OUTPUT_DIR = args.output_dir
|
47 |
|
|
|
27 |
|
28 |
# Use the original GPU ID throughout the entire code for consistency
|
29 |
GPU_ID = args.gpu
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
DEFAULT_MODEL_PATH = args.model_path
|
31 |
OUTPUT_DIR = args.output_dir
|
32 |
|