File size: 541 Bytes
15c46ce
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""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"])