From 9ed88e49abdf57a20a42dfaa5bb911c05f42c1f7 Mon Sep 17 00:00:00 2001 From: Vidalnt Date: Sat, 7 Sep 2024 20:20:06 -0500 Subject: [PATCH] Revert "Update pre_colab.yml" This reverts commit 812456ee901c992563327a074a3a2410984fe902. --- .github/workflows/pre_colab.yml | 84 +++++++++++++++++++++------------ 1 file changed, 55 insertions(+), 29 deletions(-) diff --git a/.github/workflows/pre_colab.yml b/.github/workflows/pre_colab.yml index d85e2ea80..2c4db8f89 100644 --- a/.github/workflows/pre_colab.yml +++ b/.github/workflows/pre_colab.yml @@ -4,60 +4,86 @@ on: workflow_dispatch: jobs: - Windows: - runs-on: windows-latest + Kaggle: + runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10"] + 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: Install dependencies - run: | - .\run-install.bat - .\env\python.exe core.py "prerequisites" --models "True" --pretraineds_v1 "False" --pretraineds_v2 "True" --exe "True" - - - 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 - - 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 + 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 + sudo apt-get install -y pv + pip install uv huggingface_hub + uv venv .venv --python 3.10.12 + uv pip install -r requirements.txt + uv pip install https://github.com/Vidalnt/imjoy-elfinder.git + uv pip uninstall torch torchvision torchaudio + . .venv/bin/activate + python -m ensurepip + python -m pip install "pip<24.1" + python -m pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cu121 + deactivate + wget https://huggingface.co/vidalnt/env/resolve/main/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 - - name: Create ZIP file + - name: Create TAR Env run: | - $version = '${{ steps.get-version.outputs.version }}' - Compress-Archive -Path 'D:\a\Applio\Applio\*' -DestinationPath "D:\a\Applio\ApplioV$version.zip" + tar --use-compress-program="pigz --best --recursive | pv" -cvf KaggleV2.tar.gz .venv - - name: Upload Windows Compiled + - name: Upload Kaggle Env env: HF_TOKEN: ${{ secrets.HF_TOKEN }} - version: ${{ steps.get-version.outputs.version }} run: | - .\env\python.exe -c " + python -c " import os from huggingface_hub import login, upload_file - + token = os.getenv('HF_TOKEN') - version = os.getenv('version') login(token) - repo_id = 'vidalnt/nothing' - repo_file_path = f'D:/a/Applio/ApplioV{version}.zip' - + repo_id = 'IAHispano/Applio' + repo_file_path = 'KaggleV2.tar.gz' + upload_file( - commit_message=f'{version}', path_or_fileobj=repo_file_path, - path_in_repo=f'Compiled/Windows/ApplioV{version}.zip', + path_in_repo=f'Enviroment/Kaggle/{repo_file_path}', repo_id=repo_id, token=token) " \ No newline at end of file