Download code/scripts/start.py from CollinMa/nextgpt-chapter6-report: direct link, hf CLI and curl.
- Browser
- Download file 541 Bytes
-
https://huggingface.co/spaces/CollinMa/nextgpt-chapter6-report/resolve/main/code/scripts/start.py
- Command line
-
hf download hf://spaces/CollinMa/nextgpt-chapter6-report/code/scripts/start.py
-
curl -L -o start.py https://huggingface.co/spaces/CollinMa/nextgpt-chapter6-report/resolve/main/code/scripts/start.py
541 Bytes
| """Container startup. Paid hardware is never provisioned by this script.""" | |
| import os | |
| import subprocess | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| os.chdir(ROOT) | |
| if os.getenv("NEXTGPT_AUTO_PREPARE", "0") == "1": | |
| import torch | |
| if not torch.cuda.is_available(): | |
| raise SystemExit("AUTO_PREPARE=1 requires a CUDA GPU. No weights downloaded.") | |
| subprocess.run([sys.executable, "scripts/prepare_weights.py", "--merge-vicuna"], check=True) | |
| os.execv(sys.executable, [sys.executable, "app.py"]) | |