-
-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM python:3.10-bullseye | ||
|
||
EXPOSE 6969 | ||
|
||
WORKDIR /app | ||
|
||
RUN apt update && apt install -y -qq ffmpeg aria2 && apt clean | ||
|
||
RUN pip3 install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
|
||
VOLUME [ "/app/logs/weights", "/app/opt" ] | ||
|
||
ENTRYPOINT [ "python3" ] | ||
|
||
CMD ["app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.PHONY: | ||
.ONESHELL: | ||
|
||
# Show help message | ||
help: | ||
@grep -hE '^[A-Za-z0-9_ \-]*?:.*##.*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
# Install dependencies | ||
run-install: | ||
apt-get -y install build-essential python3-dev ffmpeg | ||
pip install --upgrade setuptools wheel | ||
pip install --upgrade pip | ||
pip install faiss-gpu fairseq gradio ffmpeg ffmpeg-python praat-parselmouth pyworld numpy==1.23.5 numba==0.56.4 librosa==0.9.1 | ||
pip install -r requirements.txt | ||
pip install --upgrade lxml | ||
apt-get update | ||
|
||
# Run Applio | ||
run-applio: | ||
python app.py | ||
|
||
# Run Tensorboard | ||
run-tensorboard: | ||
python core.py tensorboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: '1' | ||
|
||
services: | ||
applio: | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile | ||
ports: | ||
- "6969" | ||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: nvidia | ||
count: 1 | ||
capabilities: [gpu] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
printf "\033]0;Applio\007" | ||
. .venv/bin/activate | ||
|
||
clear | ||
python app.py --open |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/sh | ||
printf "\033]0;Installer\007" | ||
clear | ||
rm *.bat | ||
|
||
# Function to create or activate a virtual environment | ||
prepare_install() { | ||
if [ -d ".venv" ]; then | ||
echo "Venv found. This implies Applio has been already installed or this is a broken install" | ||
printf "Do you want to execute run-applio.sh? (Y/N): " >&2 | ||
read -r r | ||
r=$(echo "$r" | tr '[:upper:]' '[:lower:]') | ||
if [ "$r" = "y" ]; then | ||
./run-applio.sh && exit 1 | ||
else | ||
echo "Ok! The installation will continue. Good luck!" | ||
fi | ||
. .venv/bin/activate | ||
else | ||
echo "Creating venv..." | ||
requirements_file="requirements.txt" | ||
echo "Checking if python exists" | ||
if command -v python3 > /dev/null 2>&1; then | ||
py=$(which python3) | ||
echo "Using python3" | ||
else | ||
if python --version | grep -q 3.; then | ||
py=$(which python) | ||
echo "Using python" | ||
else | ||
echo "Please install Python3 or 3.11 manually." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
$py -m venv .venv | ||
. .venv/bin/activate | ||
python -m ensurepip | ||
# Update pip within the virtual environment | ||
pip3 install --upgrade pip | ||
echo | ||
echo "Installing Applio dependencies..." | ||
python -m pip install -r requirements.txt | ||
python -m pip uninstall torch torchvision torchaudio -y | ||
python -m pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 --index-url https://download.pytorch.org/whl/cu117 | ||
finish | ||
fi | ||
} | ||
|
||
# Function to finish installation (this should install missing dependencies) | ||
finish() { | ||
# Check if required packages are installed and install them if not | ||
if [ -f "${requirements_file}" ]; then | ||
installed_packages=$(python -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..." | ||
python -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 | ||
clear | ||
echo "Applio has been successfully downloaded. Run the file run-applio.sh to run the web interface!" | ||
exit 0 | ||
} | ||
|
||
# Loop to the main menu | ||
if [ "$(uname)" = "Darwin" ]; then | ||
if ! command -v brew >/dev/null 2>&1; then | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
else | ||
brew install python | ||
export PYTORCH_ENABLE_MPS_FALLBACK=1 | ||
export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 | ||
fi | ||
elif [ "$(uname)" != "Linux" ]; then | ||
echo "Unsupported operating system. Are you using Windows...?" | ||
echo "If yes, use the batch (.bat) file instead of this one!" | ||
exit 1 | ||
fi | ||
|
||
prepare_install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
printf "\033]0;Tensorboard\007" | ||
. .venv/bin/activate | ||
|
||
clear | ||
python core.py tensorboard |