ChickenRice-Transcribe/run_infer_cuda.sh

25 lines
486 B
Bash
Raw Normal View History

2026-03-01 22:54:27 +08:00
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
source .venv/bin/activate
CUDA_LIBS="$(python - <<'PY'
import site, os, glob
dirs=[]
for p in site.getsitepackages():
dirs += glob.glob(os.path.join(p,"nvidia","*","lib"))
dirs=[d for d in dirs if os.path.isdir(d)]
seen=set(); out=[]
for d in dirs:
if d not in seen:
seen.add(d); out.append(d)
print(":".join(out))
PY
)"
export LD_LIBRARY_PATH="${CUDA_LIBS}:${LD_LIBRARY_PATH:-}"
exec python infer.py "$@"