CoolFace
Apppublic

Paolify/RVC_v2

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
run.sh62 linesDownload Raw Back to root
1#!/bin/bash2 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  source .venv/bin/activate15else16  echo "Create venv..."17  requirements_file="requirements.txt"18 19  # Check if Python 3.8 is installed20  if ! command -v python3 &> /dev/null; then21    echo "Python 3 not found. Attempting to install 3.8..."22    if [[ "$(uname)" == "Darwin" ]] && command -v brew &> /dev/null; then23      brew install python@3.824    elif [[ "$(uname)" == "Linux" ]] && command -v apt-get &> /dev/null; 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 -m venv .venv34  source .venv/bin/activate35 36  # Check if required packages are installed and install them if not37  if [ -f "${requirements_file}" ]; then38    installed_packages=$(python3 -m pip freeze)39    while IFS= read -r package; do40      [[ "${package}" =~ ^#.* ]] && 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 -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 models54./tools/dlmodels.sh55 56if [[ $? -ne 0 ]]; then57  exit 158fi59 60# Run the main script61python3 infer-web.py --pycmd python362