diff --git a/.github/workflows/pre_compiled.yml b/.github/workflows/pre_compiled.yml index 433442a0..e6275568 100644 --- a/.github/workflows/pre_compiled.yml +++ b/.github/workflows/pre_compiled.yml @@ -16,33 +16,26 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies run: | .\run-install.bat .\env\python.exe core.py "prerequisites" --models "True" --exe "True" --pretraineds_v1_f0 "False" --pretraineds_v2_f0 "True" --pretraineds_v1_nof0 "False" --pretraineds_v2_nof0 "False" - - name: Clean up unnecessary files run: | - Remove-Item -Path 'LICENSE', 'run-tensorboard.sh', 'run-install.sh', 'run-applio.sh', 'run-install.bat', 'requirements.txt', '.gitignore' -Force -ErrorAction SilentlyContinue - Remove-Item -Path '.github' -Recurse -Force -ErrorAction SilentlyContinue - + Remove-Item -Path 'LICENSE', 'run-tensorboard.sh', 'run-install.sh', 'run-applio.sh', 'run-install.bat', 'requirements.txt', '.gitignore', '.github', '.git' -Recurse -Force -ErrorAction SilentlyContinue - name: Read version from config.json id: get-version run: | $version = (Get-Content -Path './assets/config.json' | ConvertFrom-Json).version echo "version=$version" >> $env:GITHUB_OUTPUT - - name: Create ZIP file run: | $version = '${{ steps.get-version.outputs.version }}' Compress-Archive -Path 'D:\a\Applio\Applio\*' -DestinationPath "D:\a\Applio\ApplioV$version.zip" - - name: Upload Windows Compiled env: HF_TOKEN: ${{ secrets.HF_TOKEN }} @@ -65,7 +58,71 @@ jobs: repo_id=repo_id, token=token) " + Linux: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10.12"] + + steps: + - uses: actions/checkout@v3 + - name: Free up space on runner + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /opt/ghc + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Read version from config.json + id: get-version + run: | + version=$(jq -r '.version' assets/config.json) + echo "version=$version" >> $GITHUB_OUTPUT + - name: Create virtual environment + run: | + pip install huggingface_hub + python -m venv .venv + . .venv/bin/activate + python -m ensurepip + python -m pip install "pip<24.1" + python -m pip install -r requirements.txt + python -m pip install torch==2.3.1 torchvision torchaudio --upgrade --index-url https://download.pytorch.org/whl/cu121 + python core.py "prerequisites" --models "True" --exe "False" --pretraineds_v1_f0 "False" --pretraineds_v2_f0 "True" --pretraineds_v1_nof0 "False" --pretraineds_v2_nof0 "False" + find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete + deactivate + rm -f .venv/bin/Activate.ps1 .venv/bin/activate .venv/bin/activate.csh .venv/bin/activate.fish .venv/bin/pip .venv/bin/pip3 .venv/bin/pip3.10 .venv/bin/python .venv/bin/python3 .venv/bin/python3.10 + - name: Clean up unnecessary files + run: | + rm -f LICENSE run-tensorboard.bat run-install.bat run-applio.bat run-install.sh requirements.txt .gitignore + rm -rf .github .git + - name: Create ZIP file + run: | + zip -9 -r ApplioV${{ steps.get-version.outputs.version }}.zip . + - name: Upload Linux Compiled + env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} + version: ${{ steps.get-version.outputs.version }} + run: | + python -c " + import os + from huggingface_hub import login, upload_file + + token = os.getenv('HF_TOKEN') + version = os.getenv('version') + login(token) + repo_id = 'IAHispano/Applio' + repo_file_path = f'ApplioV{version}.zip' + upload_file( + commit_message=f'{version}', + path_or_fileobj=repo_file_path, + path_in_repo=f'Compiled/Linux/ApplioV{version}.zip', + repo_id=repo_id, + token=token) + " Kaggle: runs-on: ubuntu-latest strategy: @@ -74,25 +131,21 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Free up space on runner run: | sudo rm -rf /usr/share/dotnet sudo rm -rf /opt/ghc sudo rm -rf "/usr/local/share/boost" sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Read version from config.json id: get-version run: | version=$(jq -r '.version' assets/config.json) echo "version=$version" >> $GITHUB_OUTPUT - - name: Install uv and create virtual environment run: | sudo apt-get install -y pigz @@ -105,31 +158,17 @@ jobs: . .venv/bin/activate python -m ensurepip python -m pip install "pip<24.1" - python -m pip install torch==2.3.1 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 + python -m pip install torch==2.3.1 torchvision torchaudio --upgrade --index-url https://download.pytorch.org/whl/cu121 deactivate wget https://huggingface.co/IAHispano/Applio/resolve/main/Enviroment/Kaggle/bin_kaggle.tar.gz?download=true -O bin_kaggle.tar.gz tar -xzf bin_kaggle.tar.gz cp -r bin/* .venv/bin/ rm -rf bin rm bin_kaggle.tar.gz - rm -f .venv/pyvenv.cfg - rm -f .venv/bin/activate - rm -f .venv/bin/activate.bat - rm -f .venv/bin/activate.csh - rm -f .venv/bin/activate.fish - rm -f .venv/bin/activate.nu - rm -f .venv/bin/activate.ps1 - rm -f .venv/bin/activate_this.py - rm -f .venv/bin/deactivate.bat - rm -f .venv/bin/pydoc.bat - rm -f .venv/bin/python - rm -f .venv/bin/python3 - rm -f .venv/bin/python3.10 - + rm -f .venv/pyvenv.cfg .venv/bin/activate .venv/bin/activate.bat .venv/bin/activate.csh .venv/bin/activate.fish .venv/bin/activate.nu .venv/bin/activate.ps1 .venv/bin/activate_this.py .venv/bin/deactivate.bat .venv/bin/pydoc.bat .venv/bin/python .venv/bin/python3 .venv/bin/python3.10 - name: Create TAR Env run: | tar --use-compress-program="pigz --best --recursive | pv" -cvf KaggleV2.tar.gz .venv - - name: Upload Kaggle Env env: HF_TOKEN: ${{ secrets.HF_TOKEN }} @@ -161,12 +200,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Download and extract pre-packaged dependencies run: | wget https://huggingface.co/IAHispano/Applio/resolve/main/Enviroment/Colab/tmp_packages.tar.gz?download=true -O prepackaged.tar.gz @@ -195,11 +232,10 @@ jobs: print(f'Finished recording filesystem timestamps to {output_file}.') scan_and_write(\"/opt/hostedtoolcache/Python/3.10.12/x64\", \"./usr_files.csv\")" - - name: Install dependencies run: | pip install -r requirements.txt - + pip install torch==2.3.1 torchvision torchaudio --upgrade --index-url https://download.pytorch.org/whl/cu121 - name: Record final state of site-packages run: | python -c " @@ -219,7 +255,6 @@ jobs: print(f'Finished recording filesystem timestamps to {output_file}.') scan_and_write(\"/opt/hostedtoolcache/Python/3.10.12/x64\", \"./usr_files_new.csv\")" - - name: Create TAR file run: | python -c "