Skip to content

Commit a585468

Browse files
authored
Merge pull request #1219 from IAHispano/py312
Py312
2 parents 11fd20f + e9584f1 commit a585468

10 files changed

Lines changed: 610 additions & 582 deletions

File tree

.github/workflows/pre_compiled.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: windows-latest
1313
strategy:
1414
matrix:
15-
python-version: ["3.11"]
15+
python-version: ["3.12"]
1616

1717
steps:
1818
- uses: actions/checkout@v4

app.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,7 @@
7373

7474
# Define Gradio interface
7575
with gr.Blocks(
76-
theme=my_applio,
7776
title="Applio",
78-
css="footer{display:none !important}",
79-
js=(
80-
pathlib.Path(os.path.join(now_dir, "tabs", "realtime", "main.js")).read_text()
81-
if client_mode
82-
else None
83-
),
8477
) as Applio:
8578
gr.Markdown("# Applio")
8679
gr.Markdown(
@@ -138,6 +131,13 @@ def launch_gradio(server_name: str, server_port: int) -> None:
138131
server_name=server_name,
139132
server_port=server_port,
140133
prevent_thread_lock=client_mode,
134+
theme=my_applio,
135+
css="footer{display:none !important}",
136+
js=(
137+
pathlib.Path(os.path.join(now_dir, "tabs", "realtime", "main.js")).read_text()
138+
if client_mode
139+
else None
140+
),
141141
)
142142

143143
if client_mode:

assets/Applio.ipynb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,8 @@
8686
"%cd {repo_name}\n",
8787
"clear_output()\n",
8888
"\n",
89-
"# Install older python\n",
9089
"!apt update -y\n",
91-
"!apt install -y python3.11 python3.11-distutils python3.11-dev portaudio19-dev\n",
92-
"!update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2\n",
93-
"!update-alternatives --set python3 /usr/bin/python3.11\n",
94-
"from sys import path\n",
95-
"path.append('/usr/local/lib/python3.11/dist-packages')\n",
90+
"!apt install -y portaudio19-dev\n",
9691
"\n",
9792
"print(\"Installing requirements...\")\n",
9893
"!curl -LsSf https://astral.sh/uv/install.sh | sh\n",

assets/Applio_Kaggle.ipynb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@
5656
"!git clone --depth 1 $uioawhd $new_name --branch 3.6.1\n",
5757
"clear_output()\n",
5858
"!apt update -y\n",
59-
"!apt install -y python3.11 python3.11-distutils python3.11-dev portaudio19-dev psmisc\n",
60-
"!update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2\n",
61-
"!update-alternatives --set python3 /usr/bin/python3.11\n",
59+
"!apt install -y portaudio19-dev psmisc\n",
6260
"!uv pip install -q -r /kaggle/working/program_ml/requirements.txt --extra-index-url https://download.pytorch.org/whl/cu128 --index-strategy unsafe-best-match --system\n",
6361
"%cd /kaggle/working/program_ml\n",
6462
"!python core.py \"prerequisites\" --models \"True\" --exe \"True\" --pretraineds_hifigan \"True\" > /dev/null 2>&1\n",

assets/Applio_NoUI.ipynb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,8 @@
8787
"!git clone https://github.com/IAHispano/Applio --branch 3.6.1 --single-branch\n",
8888
"%cd /content/Applio\n",
8989
"\n",
90-
"# Install older python\n",
9190
"!apt update -y\n",
92-
"!apt install -y python3.11 python3.11-distutils python3.11-dev portaudio19-dev\n",
93-
"!update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2\n",
94-
"!update-alternatives --set python3 /usr/bin/python3.11\n",
95-
"from sys import path\n",
96-
"path.append('/usr/local/lib/python3.11/dist-packages')\n",
91+
"!apt install -y portaudio19-dev\n",
9792
"\n",
9893
"print(\"Installing requirements...\")\n",
9994
"!curl -LsSf https://astral.sh/uv/install.sh | sh\n",

requirements.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
pip>=23.3; sys_platform == 'darwin'
33
wheel; sys_platform == 'darwin'
44
PyYAML; sys_platform == 'darwin'
5-
numpy==1.26.4
5+
numpy==2.3.5
66
requests>=2.31.0,<2.32.0
77
tqdm
88
wget
99

1010
# Audio processing
1111
ffmpeg-python>=0.2.0
12-
faiss-cpu==1.7.3
12+
faiss-cpu==1.13.2
1313
librosa==0.11.0
14-
scipy==1.11.1
14+
scipy==1.16.3
1515
soundfile==0.12.1
1616
noisereduce
1717
pedalboard
@@ -20,23 +20,22 @@ soxr
2020

2121
# Machine learning and deep learning
2222
omegaconf>=2.0.6; sys_platform == 'darwin'
23-
numba; sys_platform == 'linux'
24-
numba==0.61.0; sys_platform == 'darwin' or sys_platform == 'win32'
23+
numba==0.63.1
2524
torch==2.7.1; sys_platform == 'darwin'
2625
torch==2.7.1+cu128; sys_platform == 'linux' or sys_platform == 'win32'
2726
torchaudio==2.7.1; sys_platform == 'darwin'
2827
torchaudio==2.7.1+cu128; sys_platform == 'linux' or sys_platform == 'win32'
2928
torchvision==0.22.1; sys_platform == 'darwin'
3029
torchvision==0.22.1+cu128; sys_platform == 'linux' or sys_platform == 'win32'
31-
torchcrepe==0.0.23
30+
torchcrepe
3231
torchfcpe
3332
einops
3433
transformers==4.44.2
3534

3635
# Visualization and UI
37-
matplotlib==3.7.2
36+
matplotlib==3.10.8
3837
tensorboard
39-
gradio==6.4.0
38+
gradio==6.5.1
4039

4140
# Miscellaneous utilities
4241
certifi>=2023.07.22; sys_platform == 'darwin'

run-install.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ echo.
88
set "INSTALL_DIR=%cd%"
99
set "MINICONDA_DIR=%UserProfile%\Miniconda3"
1010
set "ENV_DIR=%INSTALL_DIR%\env"
11-
set "MINICONDA_URL=https://repo.anaconda.com/miniconda/Miniconda3-py311_25.5.1-1-Windows-x86_64.exe"
11+
set "MINICONDA_URL=https://repo.anaconda.com/miniconda/Miniconda3-py312_25.11.1-1-Windows-x86_64.exe"
1212
set "CONDA_EXE=%MINICONDA_DIR%\Scripts\conda.exe"
1313

1414
set "startTime=%TIME%"
@@ -75,7 +75,7 @@ exit /b 0
7575

7676
:create_conda_env
7777
echo Creating Conda environment...
78-
call "%MINICONDA_DIR%\_conda.exe" create --no-shortcuts -y -k --prefix "%ENV_DIR%" python=3.11
78+
call "%MINICONDA_DIR%\_conda.exe" create --no-shortcuts -y -k --prefix "%ENV_DIR%" python=3.12
7979
if errorlevel 1 goto :error
8080
echo Conda environment created successfully.
8181
echo.
@@ -110,4 +110,4 @@ goto :error
110110
:error
111111
echo An error occurred during installation. Please check the output above for details.
112112
pause
113-
exit /b 1
113+
exit /b 1

run-install.sh

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e # Exit immediately if a command exits with a non-zero status
33

44
printf "\033]0;Installer\007"
55
clear
6-
rm -f *.bat
6+
rm -f *.bat
77

88
# Function to log messages with timestamps
99
log_message() {
@@ -13,13 +13,13 @@ log_message() {
1313

1414
# Function to find a suitable Python version
1515
find_python() {
16-
for py in python3.11 python3 python; do
16+
for py in python3.12 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.11."
22+
log_message "No compatible Python installation found. Please install Python 3.12."
2323
exit 1
2424
}
2525

@@ -97,13 +97,13 @@ create_venv() {
9797
py=$(find_python)
9898

9999
curl -LsSf https://astral.sh/uv/install.sh | sh
100-
uv venv .venv --python 3.11
100+
uv venv .venv --python 3.12
101101

102102
log_message "Activating virtual environment..."
103103
source .venv/bin/activate
104104

105105
install_ffmpeg
106-
install_python_ffmpeg
106+
install_python_ffmpeg
107107

108108
log_message "Installing dependencies..."
109109
if [ -f "requirements.txt" ]; then
@@ -134,41 +134,39 @@ if [ "$(uname)" = "Darwin" ]; then
134134
# Add more detailed Python version check
135135
log_message "Checking Python versions..."
136136
log_message "python3 path: $(which python3)"
137-
log_message "python3.11 path: $(which python3.11 2>/dev/null || echo 'not found')"
138-
139-
if command -v python3.11 >/dev/null 2>&1; then
140-
python_version=$(python3.11 --version | awk '{print $2}' | cut -d'.' -f1,2)
137+
log_message "python3.12 path: $(which python3.12 2>/dev/null || echo 'not found')"
138+
139+
if command -v python3.12 >/dev/null 2>&1; then
140+
python_version=$(python3.12 --version | awk '{print $2}' | cut -d'.' -f1,2)
141141
else
142142
python_version=$(python3 --version | awk '{print $2}' | cut -d'.' -f1,2)
143143
fi
144-
144+
145145
log_message "Detected Python version: $python_version"
146146

147-
if [ "$python_version" = "3.11" ]; then
148-
log_message "Found compatible Python 3.11"
147+
if [ "$python_version" = "3.12" ]; then
148+
log_message "Found compatible Python 3.12"
149149
else
150-
log_message "Python version $python_version is not 3.11. Installing Python 3.11 using Homebrew..."
151-
brew install python@3.11
152-
export PATH="$(brew --prefix)/opt/python@3.11/bin:$PATH"
150+
log_message "Python version $python_version is not 3.12. Installing Python 3.12 using Homebrew..."
151+
brew install python@3.12
152+
export PATH="$(brew --prefix)/opt/python@3.12/bin:$PATH"
153153
# Verify the installed version
154154
log_message "Verifying installed Python version..."
155-
python_version=$(python3.11 --version | awk '{print $2}' | cut -d'.' -f1,2)
156-
if [ "$python_version" != "3.11" ]; then
157-
log_message "Failed to install Python 3.11. Current version: $python_version"
155+
python_version=$(python3.12 --version | awk '{print $2}' | cut -d'.' -f1,2)
156+
if [ "$python_version" != "3.12" ]; then
157+
log_message "Failed to install Python 3.12. Current version: $python_version"
158158
exit 1
159159
fi
160160
fi
161161

162162
brew install faiss
163163
export PYTORCH_ENABLE_MPS_FALLBACK=1
164164
export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0
165-
export PATH="$(brew --prefix)/bin:$PATH"
165+
export PATH="$(brew --prefix)/bin:$PATH"
166166
elif [ "$(uname)" != "Linux" ]; then
167167
log_message "Unsupported operating system. Are you using Windows?"
168168
log_message "If yes, use the batch (.bat) file instead of this one!"
169169
exit 1
170170
fi
171171

172172
prepare_install
173-
174-

rvc/train/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,10 @@ def plot_spectrogram_to_numpy(spectrogram):
188188
plt.tight_layout()
189189

190190
fig.canvas.draw()
191-
data = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8)
192-
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
191+
buf = fig.canvas.renderer.buffer_rgba()
192+
w, h = fig.canvas.get_width_height()
193+
data = np.frombuffer(buf, dtype=np.uint8).reshape(h, w, 4)[..., :3]
194+
193195
plt.close(fig)
194196
return data
195197

0 commit comments

Comments
 (0)