Spaces:
Sleeping
Sleeping
Yaron Koresh
commited on
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def run(cmd):
|
| 2 |
+
result = subprocess.run(cmd, shell=True, capture_output=True, env=None)
|
| 3 |
+
if result.returncode != 0:
|
| 4 |
+
logging.error(
|
| 5 |
+
f"Command '{cmd}' failed with exit status code '{result.returncode}'. Exiting..."
|
| 6 |
+
)
|
| 7 |
+
sys.exit()
|
| 8 |
+
return result
|
| 9 |
+
|
| 10 |
+
run('export LD_LIBRARY_PATH="/usr/lib/wsl/lib/"')
|
| 11 |
+
run('export NUMBA_CUDA_DRIVER="/usr/lib/wsl/lib/libcuda.so.1"')
|
| 12 |
+
run('python app2.py')
|