RVC-Project / Retrieval-based-Voice-Conversion-WebUI

Easily train a good VC model with voice data <= 10 mins!
MIT License
24.86k stars 3.65k forks source link

how do i install this on mac, i need this #2279

Open vedantakbari opened 3 months ago

vedantakbari commented 3 months ago

d

jaminmc commented 2 months ago

I got it to work. I have a M1 Mac Studio... Needs Homebrew installed. I created a new run311,sh. I figure newer python is better...

#!/bin/sh

if [ "$(uname)" = "Darwin" ]; then
  # macOS specific env:
  export PYTORCH_ENABLE_MPS_FALLBACK=1
  export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0
elif [ "$(uname)" != "Linux" ]; then
  echo "Unsupported operating system."
  exit 1
fi

# Check if aria2 is installed
if command -v aria2c >/dev/null 2>&1; then
  echo "aria2 command found"
else
  echo "failed. please install aria2"
  if command -v brew >/dev/null 2>&1; then
    brew update && brew install aria2
  else
    echo "aria2 is not installed. Install it and try again"
    exit 1
  fi
fi

if [ -d ".venv" ]; then
  echo "Activate venv..."
  . .venv/bin/activate
else
  echo "Create venv..."
  requirements_file="requirements-py311.txt"

  # Check if Python 3.11 is installed
  if ! command -v python3.11 >/dev/null 2>&1 || pyenv versions --bare | grep -q "3.11"; then
    echo "Python 3 not found. Attempting to install 3.11..."
    if [ "$(uname)" = "Darwin" ] && command -v brew >/dev/null 2>&1; then
      brew install python@3.11
    elif [ "$(uname)" = "Linux" ] && command -v apt-get >/dev/null 2>&1; then
      sudo apt-get update
      sudo apt-get install python3.11
    else
      echo "Please install Python 3.11 manually."
      exit 1
    fi
  fi

  python3.11 -m venv .venv
  . .venv/bin/activate

  # Check if required packages are installed and install them if not
  if [ -f "${requirements_file}" ]; then
    installed_packages=$(python3.11 -m pip freeze)
    while IFS= read -r package; do
      expr "${package}" : "^#.*" >/dev/null && continue
      package_name=$(echo "${package}" | sed 's/[<>=!].*//')
      if ! echo "${installed_packages}" | grep -q "${package_name}"; then
        echo "${package_name} not found. Attempting to install..."
        python3.11 -m pip install --upgrade "${package}"
      fi
    done <"${requirements_file}"
  else
    echo "${requirements_file} not found. Please ensure the requirements file with required packages exists."
    exit 1
  fi
fi

# Download models
chmod +x tools/dlmodels.sh
./tools/dlmodels.sh

if [ $? -ne 0 ]; then
  exit 1
fi

# Run the main script
python3.11 infer-web.py --pycmd python3.11
vedantakbari commented 2 months ago

im rlly a noob so idk if i can follow this, if possible can you give a step by step?

jaminmc commented 2 months ago

Even though I got installed and running, It would error out too much!

I found that https://github.com/IAHispano/Applio works much better on a Mac.