fishspeech / app.py
pineconeT94's picture
auto detect cuda cpu.
35c77e1
raw
history blame contribute delete
349 Bytes
"""
#!/bin/bash
CUDA_ENABLED=${CUDA_ENABLED:-true}
DEVICE=""
if [ "${CUDA_ENABLED}" != "true" ]; then
DEVICE="--device cpu"
fi
exec python tools/webui.py ${DEVICE}
"""
import os
import torch
if torch.cuda.is_available():
DEVICE = "cuda"
else:
DEVICE = "cpu"
DEVICE = f"--device {DEVICE}"
os.system(f"python tools/webui.py {DEVICE}")