soiz1/Retrieval-based-Voice-Conversion-WebUI
0
1#!/bin/sh2 3if [ "$(uname)" = "Darwin" ]; then4 # macOS specific env:5 export PYTORCH_ENABLE_MPS_FALLBACK=16 export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.07elif [ "$(uname)" != "Linux" ]; then8 echo "Unsupported operating system."9 exit 110fi11 12if [ -d ".venv" ]; then13 echo "Activate venv..."14 . .venv/bin/activate15else16 echo "Create venv..."17 requirements_file="requirements.txt"18 19 # Check if Python 3.8 is installed20 if ! command -v python3.8 >/dev/null 2>&1 || pyenv versions --bare | grep -q "3.8"; then21 echo "Python 3 not found. Attempting to install 3.8..."22 if [ "$(uname)" = "Darwin" ] && command -v brew >/dev/null 2>&1; then23 brew install python@3.824 elif [ "$(uname)" = "Linux" ] && command -v apt-get >/dev/null 2>&1; then25 sudo apt-get update26 sudo apt-get install python3.827 else28 echo "Please install Python 3.8 manually."29 exit 130 fi31 fi32 33 python3.8 -m venv .venv34 . .venv/bin/activate35 36 # Check if required packages are installed and install them if not37 if [ -f "${requirements_file}" ]; then38 installed_packages=$(python3.8 -m pip freeze)39 while IFS= read -r package; do40 expr "${package}" : "^#.*" > /dev/null && continue41 package_name=$(echo "${package}" | sed 's/[<>=!].*//')42 if ! echo "${installed_packages}" | grep -q "${package_name}"; then43 echo "${package_name} not found. Attempting to install..."44 python3.8 -m pip install --upgrade "${package}"45 fi46 done < "${requirements_file}"47 else48 echo "${requirements_file} not found. Please ensure the requirements file with required packages exists."49 exit 150 fi51fi52 53# Download models54chmod +x tools/dlmodels.sh55./tools/dlmodels.sh56 57if [ $? -ne 0 ]; then58 exit 159fi60 61# Run the main script62python3.8 infer-web.py --pycmd python3.863 