Files
Retrieval-based-Voice-Conve…/assets-download.sh
Andrey Danilov bb2871c1ab Add GitHub Actions workflow for Docker image (#32)
* Add GitHub Actions workflow for pushing Docker images

* Fix invalid case of Docker image tag

* Optimize storage memory consumed by LFS layer

* Force workflow to run `ubuntu-22.04`

* Copy `README.md` to be included in installation with `poetry`

* Fix installation with `poetry`

* Try to optimize runner disk space consumption during build

* Optimize image building on source code changed

* Add verbose logging for downloading assets

* Add logging for disk space at GitHub Actions workflow

* Clean up some disk space usage on Docker image build

* Optimize running `poetry` on Docker image build

* Optimize `pip` taking disk space on Dociker image build

* Try to fix call of clearing `poetry` cache

* Optimize more `poetry` disk space usage

* Try to use Docker image from registry as cache

* Fix `cache-from` and `cache-to` parameters indentation

* Clean up excess workflow steps

* Fix image tag for caching of building Docker image in GitHub Actions workflow

* Disable build image caching for a while

* Remove `docker system prune` step from Docker push workflow

* Revert "Remove `docker system prune` step from Docker push workflow"

This reverts commit 7497fa35b2.

* Hardcode Docker image name

Prevent different naming for the same thing in forks.
2024-07-09 07:45:43 +09:00

53 lines
1.0 KiB
Bash

#!/usr/bin/env bash
#
# Downloads required large files for RVC.
function download() {
local path="$1"
echo "Downloading ${path}"
git lfs pull --include="${path}"
}
set -e
REPO_FOLDER="VoiceConversionWebUI"
assets_commit_hash="$1"
assets_dir="$2"
export GIT_CLONE_PROTECTION_ACTIVE=false
export GIT_LFS_SKIP_SMUDGE=1
git clone https://huggingface.co/lj1995/VoiceConversionWebUI "${REPO_FOLDER}"
pushd "${REPO_FOLDER}"
git config advice.detachedHead false
git checkout "${assets_commit_hash}"
unset GIT_LFS_SKIP_SMUDGE
unset GIT_CLONE_PROTECTION_ACTIVE
download "hubert_base.pt"
download "pretrained"
download "uvr5_weights"
download "rmvpe.pt"
download "rmvpe.onnx"
rm -rf .git
popd
mkdir -p "${assets_dir}"
mv "${REPO_FOLDER}/hubert_base.pt" "${assets_dir}/hubert_base.pt"
mkdir -p "${assets_dir}/rmvpe"
mv "${REPO_FOLDER}/rmvpe.pt" "${assets_dir}/rmvpe/rmvpe.pt"
mv "${REPO_FOLDER}/rmvpe.onnx" "${assets_dir}/rmvpe/rmvpe.onnx"
mv "${REPO_FOLDER}/pretrained" "${assets_dir}/pretrained"
mv "${REPO_FOLDER}/uvr5_weights" "${assets_dir}/uvr5_weights"