From bf27f7f607035c96e7ba778c6e631f6a3b5951a5 Mon Sep 17 00:00:00 2001 From: Blaise Date: Mon, 30 Sep 2024 21:21:49 +0200 Subject: [PATCH] Testing with new Gradio v5 --- app.py | 1 + requirements.txt | 2 +- run-install.bat | 4 ++-- run-install.sh | 2 +- tabs/inference/inference.py | 4 ++++ tabs/train/train.py | 6 ++++++ 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 4f311bded..e4dd34a4f 100644 --- a/app.py +++ b/app.py @@ -128,6 +128,7 @@ def launch_gradio(port): Applio.launch( + # ssr_mode=True, favicon_path="assets/ICON.ico", share="--share" in sys.argv, inbrowser="--open" in sys.argv, diff --git a/requirements.txt b/requirements.txt index 553e53649..575691660 100644 --- a/requirements.txt +++ b/requirements.txt @@ -39,7 +39,7 @@ transformers==4.44.2 # Visualization and UI matplotlib==3.7.2 tensorboard -gradio==4.43.0 +gradio==5.0.0b4 # Miscellaneous utilities certifi==2024.7.4; sys_platform == 'darwin' diff --git a/run-install.bat b/run-install.bat index 42b62a6ac..8637a2a66 100644 --- a/run-install.bat +++ b/run-install.bat @@ -8,7 +8,7 @@ echo. set "INSTALL_DIR=%cd%" set "MINICONDA_DIR=%UserProfile%\Miniconda3" set "ENV_DIR=%INSTALL_DIR%\env" -set "MINICONDA_URL=https://repo.anaconda.com/miniconda/Miniconda3-py39_23.9.0-0-Windows-x86_64.exe" +set "MINICONDA_URL=https://repo.anaconda.com/miniconda/Miniconda3-py310_24.7.1-0-Windows-x86_64.exe" set "CONDA_EXE=%MINICONDA_DIR%\Scripts\conda.exe" call :cleanup @@ -49,7 +49,7 @@ exit /b 0 :create_conda_env echo Creating Conda environment... -call "%MINICONDA_DIR%\_conda.exe" create --no-shortcuts -y -k --prefix "%ENV_DIR%" python=3.9 +call "%MINICONDA_DIR%\_conda.exe" create --no-shortcuts -y -k --prefix "%ENV_DIR%" python=3.10 if errorlevel 1 goto :error echo Conda environment created successfully. echo. diff --git a/run-install.sh b/run-install.sh index 96a1514cb..5377b8f06 100644 --- a/run-install.sh +++ b/run-install.sh @@ -37,7 +37,7 @@ create_venv() { py=$(which python3.10) echo "Using python3.10" else - if python --version | grep -qE "3\.(7|8|9|10)\."; then + if python --version | grep -qE "3\.(10)\."; then py=$(which python) echo "Using python" else diff --git a/tabs/inference/inference.py b/tabs/inference/inference.py index 1d3730d19..6fcb474da 100644 --- a/tabs/inference/inference.py +++ b/tabs/inference/inference.py @@ -86,6 +86,8 @@ def update_sliders(preset): + if not preset: + return None, None, None, None, None with open( os.path.join(PRESETS_DIR, f"{preset}.json"), "r", encoding="utf-8" ) as json_file: @@ -100,6 +102,8 @@ def update_sliders(preset): def update_sliders_formant(preset): + if not preset: + return None, None with open( os.path.join(FORMANTSHIFT_DIR, f"{preset}.json"), "r", encoding="utf-8" ) as json_file: diff --git a/tabs/train/train.py b/tabs/train/train.py index 3e735b09d..e648cbbb9 100644 --- a/tabs/train/train.py +++ b/tabs/train/train.py @@ -76,6 +76,7 @@ os.makedirs(custom_embedder_root, exist_ok=True) os.makedirs(pretraineds_custom_path_relative, exist_ok=True) +initial_load = True def get_pretrained_list(suffix): return [ @@ -874,6 +875,11 @@ def disable_stop_train_button(): } def download_prerequisites(version, pitch_guidance): + global initial_load + if initial_load: + initial_load = False + return + if version == "v1": if pitch_guidance: gr.Info(