Skip to content

Commit 50e8a9f

Browse files
authored
Merge pull request #1139 from Vidalnt/uvfix
Switch Linux environment to astral uv
2 parents 15c3392 + 3fb5657 commit 50e8a9f

2 files changed

Lines changed: 17 additions & 81 deletions

File tree

.github/workflows/pre_compiled.yml

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -58,69 +58,4 @@ jobs:
5858
path_in_repo=f'Compiled/Windows/ApplioV{version}.zip',
5959
repo_id=repo_id,
6060
token=token)
61-
"
62-
Linux:
63-
runs-on: ubuntu-latest
64-
strategy:
65-
matrix:
66-
python-version: ["3.11.13"]
67-
68-
steps:
69-
- uses: actions/checkout@v4
70-
- name: Free up space on runner
71-
run: |
72-
sudo rm -rf /usr/share/dotnet
73-
sudo rm -rf /opt/ghc
74-
sudo rm -rf "/usr/local/share/boost"
75-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
76-
- name: Set up Python ${{ matrix.python-version }}
77-
uses: actions/setup-python@v5
78-
with:
79-
python-version: ${{ matrix.python-version }}
80-
- name: Read version from config.json
81-
id: get-version
82-
run: |
83-
version=$(jq -r '.version' assets/config.json)
84-
echo "version=$version" >> $GITHUB_OUTPUT
85-
- name: Create virtual environment
86-
run: |
87-
pip install huggingface_hub
88-
python -m venv .venv
89-
. .venv/bin/activate
90-
python -m ensurepip
91-
python -m pip install "pip<24.1"
92-
python -m pip install -r requirements.txt
93-
python -m pip install torch==2.7.1 torchvision torchaudio==2.7.1 --upgrade --index-url https://download.pytorch.org/whl/cu128
94-
python core.py "prerequisites" --pretraineds_hifigan "True" --models "True" --exe "True"
95-
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
96-
deactivate
97-
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
98-
- name: Clean up unnecessary files
99-
run: |
100-
rm -f LICENSE run-tensorboard.bat run-install.bat run-applio.bat run-install.sh requirements.txt .gitignore
101-
rm -rf .github .git
102-
- name: Create ZIP file
103-
run: |
104-
zip -9 -r ApplioV${{ steps.get-version.outputs.version }}.zip .
105-
- name: Upload Linux Compiled
106-
env:
107-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
108-
version: ${{ steps.get-version.outputs.version }}
109-
run: |
110-
python -c "
111-
import os
112-
from huggingface_hub import login, upload_file
113-
114-
token = os.getenv('HF_TOKEN')
115-
version = os.getenv('version')
116-
login(token)
117-
repo_id = 'IAHispano/Applio'
118-
repo_file_path = f'ApplioV{version}.zip'
119-
120-
upload_file(
121-
commit_message=f'{version}',
122-
path_or_fileobj=repo_file_path,
123-
path_in_repo=f'Compiled/Linux/ApplioV{version}.zip',
124-
repo_id=repo_id,
125-
token=token)
126-
"
61+
"

run-install.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ log_message() {
1313

1414
# Function to find a suitable Python version
1515
find_python() {
16-
for py in python3.10 python3 python; do
16+
for py in python3.11 python3 python; do
1717
if command -v "$py" > /dev/null 2>&1; then
1818
echo "$py"
1919
return
2020
fi
2121
done
22-
log_message "No compatible Python installation found. Please install Python 3.10."
22+
log_message "No compatible Python installation found. Please install Python 3.11."
2323
exit 1
2424
}
2525

@@ -96,7 +96,8 @@ create_venv() {
9696
log_message "Creating virtual environment..."
9797
py=$(find_python)
9898

99-
"$py" -m venv .venv
99+
curl -LsSf https://astral.sh/uv/install.sh | sh
100+
uv venv .venv --python 3.11
100101

101102
log_message "Activating virtual environment..."
102103
source .venv/bin/activate
@@ -115,7 +116,7 @@ create_venv() {
115116

116117
log_message "Installing dependencies..."
117118
if [ -f "requirements.txt" ]; then
118-
python -m pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu128
119+
python -m pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu128 --index-strategy unsafe-best-match
119120
else
120121
log_message "requirements.txt not found. Please ensure it exists."
121122
exit 1
@@ -158,27 +159,27 @@ if [ "$(uname)" = "Darwin" ]; then
158159
# Add more detailed Python version check
159160
log_message "Checking Python versions..."
160161
log_message "python3 path: $(which python3)"
161-
log_message "python3.10 path: $(which python3.10 2>/dev/null || echo 'not found')"
162+
log_message "python3.11 path: $(which python3.11 2>/dev/null || echo 'not found')"
162163

163-
if command -v python3.10 >/dev/null 2>&1; then
164-
python_version=$(python3.10 --version | awk '{print $2}' | cut -d'.' -f1,2)
164+
if command -v python3.11 >/dev/null 2>&1; then
165+
python_version=$(python3.11 --version | awk '{print $2}' | cut -d'.' -f1,2)
165166
else
166167
python_version=$(python3 --version | awk '{print $2}' | cut -d'.' -f1,2)
167168
fi
168169

169170
log_message "Detected Python version: $python_version"
170171

171-
if [ "$python_version" = "3.10" ]; then
172-
log_message "Found compatible Python 3.10"
172+
if [ "$python_version" = "3.11" ]; then
173+
log_message "Found compatible Python 3.11"
173174
else
174-
log_message "Python version $python_version is not 3.10. Installing Python 3.10 using Homebrew..."
175-
brew install python@3.10
176-
export PATH="$(brew --prefix)/opt/python@3.10/bin:$PATH"
175+
log_message "Python version $python_version is not 3.11. Installing Python 3.11 using Homebrew..."
176+
brew install python@3.11
177+
export PATH="$(brew --prefix)/opt/python@3.11/bin:$PATH"
177178
# Verify the installed version
178179
log_message "Verifying installed Python version..."
179-
python_version=$(python3.10 --version | awk '{print $2}' | cut -d'.' -f1,2)
180-
if [ "$python_version" != "3.10" ]; then
181-
log_message "Failed to install Python 3.10. Current version: $python_version"
180+
python_version=$(python3.11 --version | awk '{print $2}' | cut -d'.' -f1,2)
181+
if [ "$python_version" != "3.11" ]; then
182+
log_message "Failed to install Python 3.11. Current version: $python_version"
182183
exit 1
183184
fi
184185
fi

0 commit comments

Comments
 (0)