Spaces:
Build error
Build error
Download app.py from asteroid8898/NBOX-test2: direct link, hf CLI and curl.
- Browser
- Download file 822 Bytes
-
https://huggingface.co/spaces/asteroid8898/NBOX-test2/resolve/main/app.py
- Command line
-
hf download hf://spaces/asteroid8898/NBOX-test2/app.py
-
curl -L -o app.py https://huggingface.co/spaces/asteroid8898/NBOX-test2/resolve/main/app.py
822 Bytes
| import subprocess | |
| import os | |
| import torch | |
| if torch.cuda.is_available(): | |
| device = "cuda" | |
| print("Using GPU") | |
| else: | |
| device = "cpu" | |
| print("Using CPU") | |
| # Clone the repository | |
| subprocess.run(["git", "clone", "https://github.com/AiAsteroid/NBOX.git", "--single-branch"], check=True) | |
| os.chdir("NBOX") | |
| # Install dependencies | |
| onnx_provider = "cuda-12.2" if device == "cuda" else "default" | |
| subprocess.run(["python", "install.py", "--onnxruntime", onnx_provider, "--skip-conda"], check=True) | |
| # Check if installation was successful by listing installed packages | |
| subprocess.run(["pip", "list"], check=True) | |
| print("DID WE GET TO THE START?????") | |
| # Run the UI | |
| subprocess.run(["python", "run.py", "--execution-providers", device]) | |
| print("DID WE GET TO THE END?????") | |
| subprocess.run(["cat", "ERROR.log"], check=True) | |