Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -31,6 +31,16 @@ GPU_ID = args.gpu
|
|
31 |
DEFAULT_MODEL_PATH = args.model_path
|
32 |
OUTPUT_DIR = args.output_dir
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
# Create necessary directories
|
35 |
os.makedirs("outputs", exist_ok=True)
|
36 |
# Create project tmp directory instead of using system temp
|
|
|
31 |
DEFAULT_MODEL_PATH = args.model_path
|
32 |
OUTPUT_DIR = args.output_dir
|
33 |
|
34 |
+
if 'CUDA_HOME' not in os.environ:
|
35 |
+
for cuda_path in ['/usr/local/cuda', '/usr/cuda', '/opt/cuda']:
|
36 |
+
if os.path.exists(cuda_path):
|
37 |
+
os.environ['CUDA_HOME'] = cuda_path
|
38 |
+
print(cuda_path)
|
39 |
+
break
|
40 |
+
if 'CUDA_HOME' not in os.environ:
|
41 |
+
os.environ['CUDA_HOME'] = '/usr/local/cuda'
|
42 |
+
print("set default cuda path in: /usr/local/cuda")
|
43 |
+
|
44 |
# Create necessary directories
|
45 |
os.makedirs("outputs", exist_ok=True)
|
46 |
# Create project tmp directory instead of using system temp
|