Add files via upload
This commit is contained in:
1 parent
0dbff4786f
commit
98a74e9625
9 files changed
+7050
-4
No files matched your search
@@ -1,5 +1,7 @@
|
||||
# AllTalk TTS v2 BETA (ITS NOT UPLOADED YET SO DONT TRY TO DO ANY OF THIS)
|
||||
This is the BETA of v2. To be clear, that means they may well be bugs, issues, missing/incomplete documentation, a variety of potential problems etc (This is what BETA refers to in the software world for those whom dont know). This means you may need a bit of technical know how to deal with things that could come up.
|
||||
# AllTalk TTS v2 BETA
|
||||
This is the BETA of v2. To be clear, that means they may well be bugs, issues, missing/incomplete documentation, a variety of potential problems etc (This is what BETA refers to in the software world for those whom dont know). This means you may need a bit of technical know how to deal with things that could come up and should only continue if you feel comfortable with that.
|
||||
|
||||
Github discussions on the BETA are [here in the discussion board](https://github.com/erew123/alltalk_tts/discussions/245)
|
||||
|
||||
#### If you are going to run the BETA, please read all the info below....
|
||||
|
||||
@@ -18,17 +20,19 @@ Seperate from Standalone installations, installation within the Text-generation-
|
||||
- Gradio web interface (see the screenshots)
|
||||
- Retrieval based Voice Conversion, AKA, RVC voice Pipeline, re-written to work on Python 3.11.
|
||||
- TTS Generator will now use any TTS engine.
|
||||
- Vastly updated API Suite. **V2 is not 100% compatable with v1.**. New SillyTavern extension is included in the `/system/` folder. See here for an explanation https://github.com/erew123/alltalk_tts/issues/166
|
||||
- Vastly updated API Suite. **V2 is not 100% compatable with v1. (See here for an explanation https://github.com/erew123/alltalk_tts/issues/166)**.
|
||||
- New SillyTavern extension is included in the `/system/` folder.
|
||||
- New remote TGWUI extension if you want to run your TTS elsewhere from the AllTalk server.
|
||||
- OpenAI compatable endpoint/API. Meaning this should work as an alternative endpoint with any software that can send a TTS generation request to OpenAI.
|
||||
- Fully customisable API Settings. I have **NOT** tested any limits of any TTS engines.
|
||||
- Updated Finetuning for XTTS models
|
||||
- Audio Transcoding to about 6x formats (mp3, opus, etc)
|
||||
- About 50 gradio interface themes if you arent happy with the standard Gradio one.
|
||||
- Documentaton has been about 80% updated. Its built into the interface.
|
||||
- Lots and lots of other things too numerous to mention.
|
||||
|
||||
There is a welcome screen that covers a few other bits, along with the built in documentation.
|
||||
|
||||
|
||||
---
|
||||
|
||||
### Windows Systems
|
||||
|
||||
+676
@@ -0,0 +1,676 @@
|
||||
@echo off
|
||||
cd /D "%~dp0"
|
||||
setlocal enabledelayedexpansion
|
||||
@set "PATH=%PATH%;%SystemRoot%\system32"
|
||||
|
||||
:: Generate the ESC character
|
||||
for /F %%a in ('echo prompt $E ^| cmd') do set "ESC=%%a"
|
||||
|
||||
:: Standard Colors
|
||||
set "BLACK=%ESC%[30m"
|
||||
set "RED=%ESC%[31m"
|
||||
set "GREEN=%ESC%[32m"
|
||||
set "YELLOW=%ESC%[33m"
|
||||
set "BLUE=%ESC%[34m"
|
||||
set "MAGENTA=%ESC%[35m"
|
||||
set "CYAN=%ESC%[36m"
|
||||
set "WHITE=%ESC%[37m"
|
||||
set "L_BLACK=%ESC%[90m"
|
||||
set "L_RED=%ESC%[91m"
|
||||
set "L_GREEN=%ESC%[92m"
|
||||
set "L_YELLOW=%ESC%[93m"
|
||||
set "L_BLUE=%ESC%[94m"
|
||||
set "L_MAGENTA=%ESC%[95m"
|
||||
set "L_CYAN=%ESC%[96m"
|
||||
set "L_WHITE=%ESC%[97m"
|
||||
set "RESET=%ESC%[0m"
|
||||
|
||||
echo "%CD%"| findstr /C:" " >nul && echo. && echo %L_BLUE%ALLTALK WINDOWS SETUP UTILITY%RESET% && echo. && echo. && echo You are trying to install AllTalk in a folder that has a space in the folder path e.g. && echo. && echo C:\%L_RED%program files%RESET%\alltalk_tts && echo. && echo This causes errors with Conda and Python scripts. Please follow this link for reference: && echo. && echo %L_CYAN%https://docs.anaconda.com/free/working-with-conda/reference/faq/#installing-anaconda%RESET% && echo. && echo Please use a folder path that has no spaces in it e.g. && echo. && echo C:\myfiles\alltalk_tts\ && echo. && echo. && pause && goto :end
|
||||
|
||||
@rem Check for special characters in installation path
|
||||
set "SPCHARMESSAGE="WARNING: Special characters were detected in the installation path!" " This can cause the installation to fail!""
|
||||
echo "%CD%"| findstr /R /C:"[!#\$%&()\*+,;<=>?@\[\]\^`{|}~]" >nul && (
|
||||
call :PrintBigMessage %SPCHARMESSAGE%
|
||||
)
|
||||
set SPCHARMESSAGE=
|
||||
|
||||
@rem Check if curl is available
|
||||
curl --version >nul 2>&1
|
||||
if "%ERRORLEVEL%" NEQ "0" (
|
||||
echo curl is not available on this system. Please install curl then re-run the script https://curl.se/
|
||||
echo or perform a manual installation of a Conda Python environment.
|
||||
goto end
|
||||
)
|
||||
|
||||
:MainMenu
|
||||
cls
|
||||
echo.
|
||||
echo %L_BLUE%ALLTALK WINDOWS SETUP UTILITY%RESET%
|
||||
echo.
|
||||
echo INSTALLATION TYPE
|
||||
echo 1) I am using AllTalk as part of %L_GREEN%Text-generation-webui%RESET%
|
||||
echo 2) I am using AllTalk as a %L_BLUE%Standalone Application%RESET%
|
||||
echo.
|
||||
echo 9) %L_RED%Exit/Quit%RESET%
|
||||
echo.
|
||||
echo.
|
||||
set /p UserOption=" Enter your choice: "
|
||||
|
||||
if "%UserOption%"=="1" goto WebUIMenu
|
||||
if "%UserOption%"=="2" goto StandaloneMenu
|
||||
if "%UserOption%"=="9" goto End
|
||||
goto MainMenu
|
||||
|
||||
:WebUIMenu
|
||||
cls
|
||||
echo.
|
||||
echo %L_BLUE%TEXT-GENERATION-WEBUI SETUP%RESET%
|
||||
echo.
|
||||
echo Please ensure you have started your Text-generation-webui Python
|
||||
echo environment. If you have NOT done this, please run %L_GREEN%cmd_windows.bat%RESET%
|
||||
echo in the %L_GREEN%text-generation-webui%RESET% folder and then re-run this script.
|
||||
echo.
|
||||
echo BASE REQUIREMENTS
|
||||
echo 1) Apply/Re-Apply the requirements for %L_GREEN%Text-generation-webui%RESET%.
|
||||
echo.
|
||||
echo OPTIONAL
|
||||
echo 2) Git Pull the latest AllTalk updates from Github
|
||||
echo.
|
||||
echo DEEPSPEED FOR %L_YELLOW=%PyTorch 2.1.x%RESET%
|
||||
echo 4) Install DeepSpeed v11.2 for CUDA %L_GREEN%11.8%RESET% and Python-3.11.x and %L_YELLOW%PyTorch 2.1.x%RESET%.
|
||||
echo 5) Install DeepSpeed v11.2 for CUDA %L_GREEN%12.1%RESET% and Python-3.11.x and %L_YELLOW%PyTorch 2.1.x%RESET%.
|
||||
echo.
|
||||
echo DEEPSPEED FOR %L_YELLOW=%PyTorch 2.2.x%RESET% (March 2024 builds of Text-gen-webui and later)
|
||||
echo 6) Install DeepSpeed v14.0 for CUDA %L_GREEN%12.1%RESET% and Python-3.11.x and %L_YELLOW%PyTorch 2.2.x%RESET%.
|
||||
echo 7) Install DeepSpeed v14.0 for CUDA %L_GREEN%11.8%RESET% and Python-3.11.x and %L_YELLOW%PyTorch 2.2.x%RESET%.
|
||||
echo.
|
||||
echo U) Uninstall DeepSpeed.
|
||||
echo.
|
||||
echo. OTHER
|
||||
echo 8) Generate a diagnostics file.
|
||||
echo.
|
||||
echo 9) %L_RED%Exit/Quit%RESET%
|
||||
echo.
|
||||
set /p WebUIOption="Enter your choice: "
|
||||
if "%WebUIOption%"=="1" goto InstallNvidiaTextGen
|
||||
if "%WebUIOption%"=="2" goto TGGitpull
|
||||
if "%WebUIOption%"=="4" goto InstallDeepSpeed118TextGen
|
||||
if "%WebUIOption%"=="5" goto InstallDeepSpeed121TextGen
|
||||
if "%WebUIOption%"=="6" goto InstallDeepSpeed121TextGenPytorch221
|
||||
if "%WebUIOption%"=="7" goto InstallDeepSpeed118TextGenPytorch221
|
||||
if "%WebUIOption%"=="U" goto UnInstallDeepSpeed
|
||||
if "%WebUIOption%"=="u" goto UnInstallDeepSpeed
|
||||
if "%WebUIOption%"=="8" goto GenerateDiagsTextGen
|
||||
if "%WebUIOption%"=="9" goto End
|
||||
goto WebUIMenu
|
||||
|
||||
:StandaloneMenu
|
||||
cls
|
||||
echo.
|
||||
echo %L_BLUE%ALLTALK STANDALONE APPLICATION SETUP%RESET%
|
||||
echo.
|
||||
echo BASE REQUIREMENTS
|
||||
echo 1) Install AllTalk as a Standalone Application
|
||||
echo.
|
||||
echo OPTIONAL
|
||||
echo 2) Git Pull the latest AllTalk updates from Github
|
||||
echo 3) Re-Apply/Update the requirements file
|
||||
echo 4) Delete AllTalk's custom Python environment
|
||||
echo 5) Purge the PIP cache
|
||||
echo.
|
||||
echo. OTHER
|
||||
echo 8) Generate a diagnostics file
|
||||
echo.
|
||||
echo 9) %L_RED%Exit/Quit%RESET%
|
||||
echo.
|
||||
set /p StandaloneOption="Enter your choice: "
|
||||
if "%StandaloneOption%"=="1" goto InstallCustomStandalone
|
||||
if "%StandaloneOption%"=="2" goto STGitpull
|
||||
if "%StandaloneOption%"=="3" goto STReapplyrequirements
|
||||
if "%StandaloneOption%"=="4" goto STDeleteCustomStandalone
|
||||
if "%StandaloneOption%"=="5" goto STPurgepipcache
|
||||
if "%StandaloneOption%"=="8" goto GenerateDiagsStandalone
|
||||
if "%StandaloneOption%"=="9" goto EndStandalone
|
||||
goto StandaloneMenu
|
||||
|
||||
:InstallNvidiaTextGen
|
||||
pip install -r system\requirements\requirements_textgen.txt
|
||||
pip install -r system\requirements\requirements_textgen2.txt
|
||||
echo ** Faiss **
|
||||
call "%CONDA_ROOT_PREFIX%\Scripts\conda.exe" install -y pytorch::faiss-cpu
|
||||
echo ** FFmpeg **
|
||||
call "%CONDA_ROOT_PREFIX%\Scripts\conda.exe" install -y conda-forge::ffmpeg
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo There was an error installing the requirements.
|
||||
echo Have you started your Text-gen-webui Python environment
|
||||
echo with cmd_{yourOS} before running atsetup.bat?
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
Echo.
|
||||
echo.
|
||||
Echo Requirements installed successfully.
|
||||
Echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
|
||||
:TGGitpull
|
||||
git pull
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo There was an error pulling from Github.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
Echo.
|
||||
echo AllTalk Updated from Github. Please re-apply
|
||||
echo the latest requirements file. Option 1
|
||||
Echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
|
||||
:InstallDeepSpeed118TextGen
|
||||
echo Downloading DeepSpeed...
|
||||
curl -LO https://github.com/erew123/alltalk_tts/releases/download/deepspeed/deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo Failed to download DeepSpeed wheel file.
|
||||
echo Please check your internet connection or try again later.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
echo DeepSpeed wheel file downloaded successfully.
|
||||
echo Installing DeepSpeed...
|
||||
pip install deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo Failed to install DeepSpeed.
|
||||
echo Please check if the wheel file is compatible with your system.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
Echo.
|
||||
echo.
|
||||
Echo DeepSpeed installed successfully.
|
||||
Echo.
|
||||
del deepspeed-0.11.2+cuda118-cp311-cp311-win_amd64.whl
|
||||
pause
|
||||
goto WebUIMenu
|
||||
|
||||
:InstallDeepSpeed121TextGen
|
||||
echo Downloading DeepSpeed...
|
||||
curl -LO https://github.com/erew123/alltalk_tts/releases/download/deepspeed/deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo Failed to download DeepSpeed wheel file.
|
||||
echo Please check your internet connection or try again later.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
echo DeepSpeed wheel file downloaded successfully.
|
||||
echo Installing DeepSpeed...
|
||||
pip install deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo Failed to install DeepSpeed.
|
||||
echo Please check if the wheel file is compatible with your system.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
Echo.
|
||||
echo.
|
||||
Echo DeepSpeed installed successfully.
|
||||
Echo.
|
||||
del deepspeed-0.11.2+cuda121-cp311-cp311-win_amd64.whl
|
||||
pause
|
||||
goto WebUIMenu
|
||||
|
||||
:InstallDeepSpeed121TextGenPytorch221
|
||||
echo Downloading DeepSpeed...
|
||||
curl -LO https://github.com/erew123/alltalk_tts/releases/download/DeepSpeed-14.0/deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo Failed to download DeepSpeed wheel file.
|
||||
echo Please check your internet connection or try again later.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
echo DeepSpeed wheel file downloaded successfully.
|
||||
echo Installing DeepSpeed...
|
||||
pip install deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo Failed to install DeepSpeed.
|
||||
echo Please check if the wheel file is compatible with your system.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
Echo.
|
||||
echo.
|
||||
Echo DeepSpeed installed successfully.
|
||||
Echo.
|
||||
del deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
|
||||
pause
|
||||
goto WebUIMenu
|
||||
|
||||
:InstallDeepSpeed118TextGenPytorch221
|
||||
echo Downloading DeepSpeed...
|
||||
curl -LO https://github.com/erew123/alltalk_tts/releases/download/DeepSpeed-14.0/deepspeed-0.14.0+cu118-cp311-cp311-win_amd64.whl
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo Failed to download DeepSpeed wheel file.
|
||||
echo Please check your internet connection or try again later.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
echo DeepSpeed wheel file downloaded successfully.
|
||||
echo Installing DeepSpeed...
|
||||
pip install deepspeed-0.14.0+cu118-cp311-cp311-win_amd64.whl
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo Failed to install DeepSpeed.
|
||||
echo Please check if the wheel file is compatible with your system.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
Echo.
|
||||
echo.
|
||||
Echo DeepSpeed installed successfully.
|
||||
Echo.
|
||||
del deepspeed-0.14.0+cu118-cp311-cp311-win_amd64.whl
|
||||
pause
|
||||
goto WebUIMenu
|
||||
|
||||
:UnInstallDeepSpeed
|
||||
pip uninstall deepspeed
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo There was an error uninstalling DeepSpeed.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
echo.
|
||||
Echo DeepSpeed uninstalled successfully.
|
||||
Echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
|
||||
:GenerateDiagsTextGen
|
||||
Python diagnostics.py
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo There was an error running diagnostics. Have you correctly started your
|
||||
echo Text-generation-webui Python environment with %L_GREEN%cmd_windows.bat%RESET%?
|
||||
echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
)
|
||||
Echo.
|
||||
echo.
|
||||
Echo Diagnostics.log generated. Please scroll up to look over the log.
|
||||
Echo.
|
||||
pause
|
||||
goto WebUIMenu
|
||||
|
||||
:InstallCustomStandalone
|
||||
set PATH=%PATH%;%SystemRoot%\system32
|
||||
|
||||
@rem Check if curl is available
|
||||
curl --version >nul 2>&1
|
||||
if "%ERRORLEVEL%" NEQ "0" (
|
||||
echo curl is not available on this system. Please install curl then re-run the script https://curl.se/
|
||||
echo or perform a manual installation of a Conda Python environment.
|
||||
goto end
|
||||
)
|
||||
echo "%CD%"| findstr /C:" " >nul && echo This script relies on Miniconda which can not be silently installed under a path with spaces. Please correct your folder names and re-try installation. && goto exit
|
||||
|
||||
@rem Check for special characters in installation path
|
||||
set "SPCHARMESSAGE=WARNING: Special characters were detected in the installation path! This can cause the installation to fail!"
|
||||
echo "%CD%"| findstr /R /C:"[!#\$%&()\*+,;<=>?@\[\]\^`{|}~]" >nul && (
|
||||
call :PrintBigMessage %SPCHARMESSAGE%
|
||||
)
|
||||
set SPCHARMESSAGE=
|
||||
|
||||
@rem fix failed install when installing to a separate drive
|
||||
set TMP=%cd%\alltalk_environment
|
||||
set TEMP=%cd%\alltalk_environment
|
||||
|
||||
@rem deactivate existing conda envs as needed to avoid conflicts
|
||||
(call conda deactivate && call conda deactivate && call conda deactivate) 2>nul
|
||||
|
||||
@rem config
|
||||
set INSTALL_DIR=%cd%\alltalk_environment
|
||||
set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
|
||||
set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
|
||||
set MINICONDA_DOWNLOAD_URL=https://repo.anaconda.com/miniconda/Miniconda3-py311_24.4.0-0-Windows-x86_64.exe
|
||||
set conda_exists=F
|
||||
|
||||
@rem figure out whether git and conda need to be installed
|
||||
call "%CONDA_ROOT_PREFIX%\_conda.exe" --version >nul 2>&1
|
||||
if "%ERRORLEVEL%" EQU "0" (
|
||||
set conda_exists=T
|
||||
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
|
||||
goto RunScript
|
||||
)
|
||||
|
||||
@rem download and install conda if not installed
|
||||
echo Downloading Miniconda from %MINICONDA_DOWNLOAD_URL% to %INSTALL_DIR%\miniconda_installer.exe
|
||||
mkdir "%INSTALL_DIR%"
|
||||
call curl -Lk "%MINICONDA_DOWNLOAD_URL%" > "%INSTALL_DIR%\miniconda_installer.exe" || ( echo. && echo Miniconda failed to download. && goto end )
|
||||
echo Installing Miniconda to %CONDA_ROOT_PREFIX%
|
||||
start /wait "" "%INSTALL_DIR%\miniconda_installer.exe" /InstallationType=JustMe /NoShortcuts=1 /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /S /D=%CONDA_ROOT_PREFIX%
|
||||
echo Miniconda version:
|
||||
call "%CONDA_ROOT_PREFIX%\_conda.exe" --version || ( echo. && echo Miniconda not found. && goto end )
|
||||
|
||||
@rem create the installer env
|
||||
echo Packages to install: %PACKAGES_TO_INSTALL%
|
||||
call "%CONDA_ROOT_PREFIX%\_conda.exe" create --no-shortcuts -y -k --prefix "%INSTALL_ENV_DIR%" python=3.11.9 || ( echo. && echo Conda environment creation failed. && goto end )
|
||||
|
||||
@rem check if conda environment was actually created
|
||||
if not exist "%INSTALL_ENV_DIR%\python.exe" ( echo. && echo Conda environment is empty. && goto end )
|
||||
|
||||
@rem activate installer env
|
||||
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" || ( echo. && echo Miniconda hook not found. && goto end )
|
||||
rem Install required packages
|
||||
@rem Enable conda logging
|
||||
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" config --set log_level debug
|
||||
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" config --set log_file "%INSTALL_ENV_DIR%\conda.log"
|
||||
echo ** PyTorch 2.2.1 **
|
||||
call "%CONDA_ROOT_PREFIX%\Scripts\conda.exe" install -y pytorch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 pytorch-cuda=12.1 -c pytorch -c nvidia
|
||||
echo ** Faiss **
|
||||
call "%CONDA_ROOT_PREFIX%\Scripts\conda.exe" install -y pytorch::faiss-cpu
|
||||
echo ** FFmpeg **
|
||||
call "%CONDA_ROOT_PREFIX%\Scripts\conda.exe" install -y conda-forge::ffmpeg
|
||||
echo ** Requirements file **
|
||||
pip install -r system\requirements\requirements_standalone.txt
|
||||
echo ** Gradio Update **
|
||||
pip install --upgrade gradio==4.32.2
|
||||
echo ** DeepSpeed **
|
||||
curl -LO https://github.com/erew123/alltalk_tts/releases/download/DeepSpeed-14.0/deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
|
||||
echo Installing DeepSpeed...
|
||||
pip install deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
|
||||
del deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
|
||||
echo ** Clean Environment **
|
||||
call "%CONDA_ROOT_PREFIX%\Scripts\conda.exe" clean --all --force-pkgs-dirs -y
|
||||
|
||||
|
||||
@rem Create start_environment.bat to run AllTalk environment
|
||||
echo @echo off > start_environment.bat
|
||||
echo cd /D "%~dp0" >> start_environment.bat
|
||||
echo set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda >> start_environment.bat
|
||||
echo set INSTALL_ENV_DIR=%cd%\alltalk_environment\env >> start_environment.bat
|
||||
echo call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" >> start_environment.bat
|
||||
@rem Create start_alltalk.bat to run AllTalk
|
||||
echo @echo off > start_alltalk.bat
|
||||
echo cd /D "%~dp0" >> start_alltalk.bat
|
||||
echo set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda >> start_alltalk.bat
|
||||
echo set INSTALL_ENV_DIR=%cd%\alltalk_environment\env >> start_alltalk.bat
|
||||
echo call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" >> start_alltalk.bat
|
||||
echo call python script.py >> start_alltalk.bat
|
||||
@rem Create start_finetune.bat to run AllTalk
|
||||
echo @echo off > start_finetune.bat
|
||||
echo cd /D "%~dp0" >> start_finetune.bat
|
||||
echo set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda >> start_finetune.bat
|
||||
echo set INSTALL_ENV_DIR=%cd%\alltalk_environment\env >> start_finetune.bat
|
||||
echo call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" >> start_finetune.bat
|
||||
echo call python finetune.py >> start_finetune.bat
|
||||
echo @echo off > start_diagnostics.bat
|
||||
echo cd /D "%~dp0" >> start_diagnostics.bat
|
||||
echo set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda >> start_diagnostics.bat
|
||||
echo set INSTALL_ENV_DIR=%cd%\alltalk_environment\env >> start_diagnostics.bat
|
||||
echo call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%" >> start_diagnostics.bat
|
||||
echo call python diagnostics.py >> start_diagnostics.bat
|
||||
Echo.
|
||||
Echo Run %L_YELLOW%start_alltalk.bat%RESET% to start AllTalk.
|
||||
Echo Run %L_YELLOW%start_diagnostics.bat%RESET% to start the diagnostics.
|
||||
Echo Run %L_YELLOW%start_finetune.bat%RESET% to start Finetuning.
|
||||
Echo Run %L_YELLOW%start_environment.bat%RESET% to start the AllTalk Python environment.
|
||||
Echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
|
||||
:STDeleteCustomStandalone
|
||||
@rem Check if the alltalk_environment directory exists
|
||||
if not exist "%cd%\alltalk_environment\" (
|
||||
echo.
|
||||
echo %L_GREEN%alltalk_environment%RESET% directory does not exist. No need to delete.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
@rem Check if a Conda environment is active
|
||||
if not defined CONDA_PREFIX goto NoCondaEnvDeleteCustomStandalone
|
||||
@rem Deactivate Conda environment if it's active
|
||||
Echo Exiting the Conda Environment. Please run %L_GREEN%atsetup.bat%RESET% again and delete the environment.
|
||||
call conda deactivate
|
||||
:NoCondaEnvDeleteCustomStandalone
|
||||
echo Deleting "alltalk_environment". Please wait.
|
||||
rd /s /q "alltalk_environment"
|
||||
del start_alltalk.bat
|
||||
del start_environment.bat
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo Failed to delete alltalk_environment folder.
|
||||
echo Please make sure it is not in use and try again.
|
||||
echo Worst case, manually delete the folder called 'alltalk_environment'
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
echo.
|
||||
Echo.
|
||||
echo Environment %L_GREEN%alltalk_environment%RESET% deleted. Please set up the environment again.
|
||||
Echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
|
||||
:GenerateDiagsStandalone
|
||||
cd /D "%~dp0"
|
||||
set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
|
||||
set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
|
||||
@rem Check if the Conda environment exists
|
||||
if not exist "%INSTALL_ENV_DIR%\python.exe" (
|
||||
echo.
|
||||
echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
|
||||
echo Please install the environment before proceeding.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
@rem Attempt to activate the Conda environment
|
||||
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
|
||||
if errorlevel 1 (
|
||||
echo.
|
||||
echo Failed to activate the Conda environment.
|
||||
echo Please check your installation and try again.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
@rem Run diagnostics
|
||||
Python diagnostics.py
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo There was an error running diagnostics.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
Echo.
|
||||
Echo.
|
||||
Echo Diagnostics.log generated. Please scroll up to look over the log.
|
||||
Echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
|
||||
:STReapplyrequirements
|
||||
cd /D "%~dp0"
|
||||
set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
|
||||
set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
|
||||
@rem Check if the Conda environment exists
|
||||
if not exist "%INSTALL_ENV_DIR%\python.exe" (
|
||||
echo.
|
||||
echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
|
||||
echo Please install the environment before proceeding.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
@rem Attempt to activate the Conda environment
|
||||
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
|
||||
if errorlevel 1 (
|
||||
echo.
|
||||
echo Failed to activate the Conda environment.
|
||||
echo Please check your installation and try again.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
@rem Run Reapply requirements
|
||||
echo.
|
||||
echo.
|
||||
echo Installing requirements. If you have problems after this, you should
|
||||
echo delete the alltalk_environment and run the setup routine again.
|
||||
echo.
|
||||
pip install -r system\requirements\requirements_standalone.txt
|
||||
echo Installing DeepSpeed...
|
||||
pip install deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
|
||||
del deepspeed-0.14.0+ce78a63-cp311-cp311-win_amd64.whl
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo There was an error.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
Echo.
|
||||
Echo.
|
||||
Echo Requirements have been re-applied/updated.
|
||||
Echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
|
||||
:STPurgepipcache
|
||||
cd /D "%~dp0"
|
||||
set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
|
||||
set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
|
||||
@rem Check if the Conda environment exists
|
||||
if not exist "%INSTALL_ENV_DIR%\python.exe" (
|
||||
echo.
|
||||
echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
|
||||
echo Please install the environment before proceeding.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
@rem Attempt to activate the Conda environment
|
||||
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
|
||||
if errorlevel 1 (
|
||||
echo.
|
||||
echo Failed to activate the Conda environment.
|
||||
echo Please check your installation and try again.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
@rem Clear the PIP cache
|
||||
echo.
|
||||
echo Purging the PIP cache of downloaded files.
|
||||
echo.
|
||||
pip cache purge
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo There was an error.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
Echo.
|
||||
Echo The PIP cache has been purged.
|
||||
Echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
|
||||
:STGitpull
|
||||
cd /D "%~dp0"
|
||||
set CONDA_ROOT_PREFIX=%cd%\alltalk_environment\conda
|
||||
set INSTALL_ENV_DIR=%cd%\alltalk_environment\env
|
||||
@rem Check if the Conda environment exists
|
||||
if not exist "%INSTALL_ENV_DIR%\python.exe" (
|
||||
echo.
|
||||
echo The Conda environment at "%INSTALL_ENV_DIR%" does not exist.
|
||||
echo Please install the environment before proceeding.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
@rem Attempt to activate the Conda environment
|
||||
call "%CONDA_ROOT_PREFIX%\condabin\conda.bat" activate "%INSTALL_ENV_DIR%"
|
||||
if errorlevel 1 (
|
||||
echo.
|
||||
echo Failed to activate the Conda environment.
|
||||
echo Please check your installation and try again.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
@rem Pull from Github
|
||||
echo.
|
||||
echo Pulling the latest updates. Please re-apply
|
||||
echo the latest requirements file. Option 3
|
||||
echo.
|
||||
git pull
|
||||
if %ERRORLEVEL% neq 0 (
|
||||
echo.
|
||||
echo There was an error pulling from Github.
|
||||
echo Press any key to return to the menu.
|
||||
echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
)
|
||||
Echo.
|
||||
echo AllTalk Updated from Github. Please re-apply
|
||||
echo the latest requirements file. Option 3
|
||||
Echo.
|
||||
pause
|
||||
goto StandaloneMenu
|
||||
|
||||
:EndStandalone
|
||||
echo Exiting AllTalk Setup Utility...
|
||||
echo.
|
||||
Echo Remember, after installation you can....
|
||||
Echo Run %L_YELLOW%start_alltalk.bat%RESET% to start AllTalk.
|
||||
Echo Run %L_YELLOW%start_finetune.bat%RESET% to start Finetuning.
|
||||
Echo Run %L_YELLOW%start_environment.bat%RESET% to start the AllTalk Python environment.
|
||||
Echo.
|
||||
exit /b
|
||||
|
||||
:End
|
||||
echo Exiting AllTalk Setup Utility...
|
||||
exit /b
|
||||
+590
@@ -0,0 +1,590 @@
|
||||
#!/bin/bash
|
||||
|
||||
# ANSI color codes
|
||||
RED='\033[1;31m'
|
||||
GREEN='\033[1;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[1;34m'
|
||||
CYAN='\033[1;36m'
|
||||
MAGENTA='\033[1;35m'
|
||||
WHITE='\033[1;37m'
|
||||
L_RED='\033[1;91m'
|
||||
L_GREEN='\033[1;92m'
|
||||
L_YELLOW='\033[1;93m'
|
||||
L_BLUE='\033[1;94m'
|
||||
L_CYAN='\033[1;96m'
|
||||
L_MAGENTA='\033[1;95m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Navigate to the script's directory
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# Function to check if curl is installed
|
||||
check_curl() {
|
||||
if ! command -v curl &> /dev/null; then
|
||||
echo "curl is not available on this system. Please install curl then re-run the script https://curl.se/"
|
||||
echo "or perform a manual installation of a Conda Python environment."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Check if the current directory path contains a space
|
||||
containsSpace=false
|
||||
currentPath=$(pwd)
|
||||
if echo "$currentPath" | grep -q ' '; then
|
||||
containsSpace=true
|
||||
fi
|
||||
|
||||
if [ "$containsSpace" = true ]; then
|
||||
echo
|
||||
echo -e " ${L_BLUE}ALLTALK LINUX SETUP UTILITY${NC}"
|
||||
echo
|
||||
echo
|
||||
echo -e " You are trying to install AllTalk in a folder that has a space in the"
|
||||
echo -e " folder path e.g."
|
||||
echo
|
||||
echo -e " /home/${L_RED}program files${NC}/alltalk_tts"
|
||||
echo
|
||||
echo -e " This causes errors with Conda and Python scripts. Please follow this"
|
||||
echo -e " link for reference:"
|
||||
echo
|
||||
echo -e " ${L_CYAN}https://docs.anaconda.com/free/working-with-conda/reference/faq/#installing-anaconda${NC}"
|
||||
echo
|
||||
echo -e " Please use a folder path that has no spaces in it e.g."
|
||||
echo
|
||||
echo -e " /home/myfiles/alltalk_tts/"
|
||||
echo
|
||||
echo
|
||||
read -p "Press Enter to continue..."
|
||||
exit 1
|
||||
else
|
||||
# Continue with the main menu
|
||||
echo "Continue with the main menu."
|
||||
fi
|
||||
|
||||
# Main Menu
|
||||
main_menu() {
|
||||
while true; do
|
||||
clear
|
||||
echo
|
||||
echo -e " ${L_BLUE}ALLTALK LINUX SETUP UTILITY${NC}"
|
||||
echo
|
||||
echo " INSTALLATION TYPE"
|
||||
echo -e " 1) I am using AllTalk as part of ${L_GREEN}Text-generation-webui${NC}"
|
||||
echo -e " 2) I am using AllTalk as a ${L_GREEN}Standalone Application${NC}"
|
||||
echo
|
||||
echo -e " 9)${L_RED} Exit/Quit${NC}"
|
||||
echo
|
||||
read -p " Enter your choice: " user_option
|
||||
|
||||
case $user_option in
|
||||
1) webui_menu ;;
|
||||
2) standalone_menu ;;
|
||||
9) exit 0 ;;
|
||||
*) echo "Invalid option"; sleep 2 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Text-generation-webui Menu
|
||||
webui_menu() {
|
||||
while true; do
|
||||
clear
|
||||
echo
|
||||
echo -e " ${L_BLUE}TEXT-GENERATION-WEBUI SETUP${NC}"
|
||||
echo
|
||||
echo -e " Please ensure you have started your Text-generation-webui Python"
|
||||
echo -e " environment. If you have NOT done this, please run ${L_GREEN}/cmd_linux.sh${NC}"
|
||||
echo -e " in the ${L_GREEN}text-generation-webui${NC} folder and then re-run this script."
|
||||
echo
|
||||
echo " BASE REQUIREMENTS"
|
||||
echo -e " 1) Apply/Re-Apply the requirements for an ${L_GREEN}Text-generation-webui${NC}"
|
||||
echo
|
||||
echo " OPTIONAL"
|
||||
echo " 2) Git Pull the latest AllTalk updates from Github"
|
||||
echo
|
||||
echo " DEEPSPEED"
|
||||
echo " 4) Install DeepSpeed."
|
||||
echo " 5) Uninstall DeepSpeed."
|
||||
echo
|
||||
echo " OTHER"
|
||||
echo " 6) Generate a diagnostics file."
|
||||
echo
|
||||
echo -e " 9)${L_RED} Exit/Quit${NC}"
|
||||
echo
|
||||
read -p " Enter your choice: " webui_option
|
||||
|
||||
case $webui_option in
|
||||
1) install_nvidia_textgen ;;
|
||||
2) tg_gitpull ;;
|
||||
4) install_deepspeed ;;
|
||||
5) uninstall_deepspeed ;;
|
||||
6) generate_diagnostics_textgen ;;
|
||||
9) exit 0 ;;
|
||||
*) echo "Invalid option"; sleep 2 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
install_nvidia_textgen() {
|
||||
local requirements_file="system/requirements/requirements_textgen.txt"
|
||||
echo " Installing Requirements from $requirements_file..."
|
||||
if ! pip install -r "$requirements_file"; then
|
||||
echo
|
||||
echo " There was an error pulling from Github."
|
||||
echo " Please check the output for details."
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
echo
|
||||
echo " Requirements installed successfully."
|
||||
|
||||
echo " Installing additional requirements..."
|
||||
if ! pip install -r system/requirements/requirements_textgen2.txt; then
|
||||
echo
|
||||
echo " There was an error installing additional requirements."
|
||||
echo " Please check the output for details."
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
|
||||
if ! conda install -y pytorch::faiss-cpu; then
|
||||
echo
|
||||
echo " There was an error installing faiss-cpu."
|
||||
echo " Please check the output for details."
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
|
||||
if ! conda install -y conda-forge::ffmpeg; then
|
||||
echo
|
||||
echo " There was an error installing ffmpeg."
|
||||
echo " Please check the output for details."
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
|
||||
echo
|
||||
echo " Additional requirements installed successfully."
|
||||
echo
|
||||
echo -e " To install ${L_YELLOW}DeepSpeed${NC} on Linux, there are additional"
|
||||
echo -e " steps required. Please see the Github or documentation on DeepSeed."
|
||||
echo
|
||||
read -p " Press any key to continue. " -n 1
|
||||
echo
|
||||
}
|
||||
|
||||
|
||||
tg_gitpull() {
|
||||
echo
|
||||
if ! git pull; then
|
||||
echo
|
||||
echo " There was an error installing the requirements."
|
||||
echo " Please check the output for details."
|
||||
echo
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
echo
|
||||
echo " AllTalk Updated from Github. Please re-apply"
|
||||
echo " the latest requirements file. (Option 1)"
|
||||
echo
|
||||
read -p " Press any key to continue. " -n 1
|
||||
echo
|
||||
}
|
||||
|
||||
# Function to install DeepSpeed
|
||||
install_deepspeed() {
|
||||
clear
|
||||
echo
|
||||
echo -e " ${L_BLUE}DEEPSPEED INSTALLATION REQUIREMENTS${NC}"
|
||||
echo
|
||||
echo -e " - Please go see this link as the instructions are there.${NC}"
|
||||
echo -e " The instructions there are making it as simple as posisble.${NC}"
|
||||
echo -e " ${L_GREEN}https://github.com/erew123/alltalk_tts/releases/tag/DeepSpeed-14.2-Linux${NC}"
|
||||
echo
|
||||
read -p " Have you completed all the above steps? (y/n): " confirm
|
||||
|
||||
if [ "$confirm" != "y" ]; then
|
||||
echo -e " ${RED}DeepSpeed installation cannot proceed without completing the prerequisites.${NC}"
|
||||
return
|
||||
fi
|
||||
|
||||
echo -e "\n ${GREEN}Proceeding with DeepSpeed installation...${NC}"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e " ${RED}There was an error installing DeepSpeed.${NC}"
|
||||
return
|
||||
fi
|
||||
|
||||
echo -e " ${GREEN}DeepSpeed installed successfully.${NC}"
|
||||
read -p " Press any key to continue. " -n 1
|
||||
echo
|
||||
}
|
||||
|
||||
uninstall_deepspeed() {
|
||||
echo "Uninstalling DeepSpeed..."
|
||||
pip uninstall -y deepspeed
|
||||
if [ $? -ne 0 ]; then
|
||||
echo
|
||||
echo " There was an error uninstalling DeepSpeed."
|
||||
echo
|
||||
echo " Press any key to return to the menu."
|
||||
read -n 1
|
||||
return
|
||||
fi
|
||||
echo
|
||||
echo " DeepSpeed uninstalled successfully."
|
||||
echo
|
||||
echo " Press any key to continue."
|
||||
read -n 1
|
||||
}
|
||||
|
||||
generate_diagnostics_textgen() {
|
||||
# Run diagnostics
|
||||
if ! python diagnostics.py; then
|
||||
echo
|
||||
echo " There was an error running diagnostics."
|
||||
echo
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
echo
|
||||
echo " Diagnostics log file generated successfully."
|
||||
echo " Please see diagnostics.log"
|
||||
echo
|
||||
read -p " Press any key to continue. " -n 1
|
||||
echo
|
||||
}
|
||||
|
||||
# Standalone Menu
|
||||
standalone_menu() {
|
||||
while true; do
|
||||
clear
|
||||
echo
|
||||
echo -e " ${L_BLUE}ALLTALK STANDALONE APPLICATION SETUP${NC}"
|
||||
echo
|
||||
echo " BASE REQUIREMENTS"
|
||||
echo " 1) Install AllTalk as a Standalone Application"
|
||||
echo
|
||||
echo " OPTIONAL"
|
||||
echo " 2) Git Pull the latest AllTalk updates from Github"
|
||||
echo " 3) Re-Apply/Update the requirements file"
|
||||
echo " 4) Delete AllTalk's custom Python environment"
|
||||
echo " 5) Purge the PIP cache"
|
||||
echo
|
||||
echo " OTHER"
|
||||
echo " 8) Generate a diagnostics file"
|
||||
echo
|
||||
echo -e " 9)${L_RED} Exit/Quit${NC}"
|
||||
echo
|
||||
read -p " Enter your choice: " standalone_option
|
||||
|
||||
case $standalone_option in
|
||||
1) install_custom_standalone ;;
|
||||
2) gitpull_standalone ;;
|
||||
3) reapply_standalone ;;
|
||||
4) delete_custom_standalone ;;
|
||||
5) pippurge_standalone ;;
|
||||
8) generate_diagnostics_standalone ;;
|
||||
9) exit 0 ;;
|
||||
*) echo "Invalid option"; sleep 2 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
install_custom_standalone() {
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
if [[ "$(pwd)" =~ " " ]]; then
|
||||
echo "This script relies on Miniconda which can not be silently installed under a path with spaces."
|
||||
exit
|
||||
fi
|
||||
|
||||
# Deactivate existing conda envs as needed to avoid conflicts
|
||||
{ conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null
|
||||
|
||||
OS_ARCH=$(uname -m)
|
||||
case "${OS_ARCH}" in
|
||||
x86_64*) OS_ARCH="x86_64" ;;
|
||||
arm64* | aarch64*) OS_ARCH="aarch64" ;;
|
||||
*) echo "Unknown system architecture: $OS_ARCH! This script runs only on x86_64 or arm64" && exit ;;
|
||||
esac
|
||||
|
||||
# Config
|
||||
INSTALL_DIR="$(pwd)/alltalk_environment"
|
||||
CONDA_ROOT_PREFIX="${INSTALL_DIR}/conda"
|
||||
INSTALL_ENV_DIR="${INSTALL_DIR}/env"
|
||||
MINICONDA_DOWNLOAD_URL="https://repo.anaconda.com/miniconda/Miniconda3-py311_24.4.0-0-Linux-${OS_ARCH}.sh"
|
||||
if [ ! -x "${CONDA_ROOT_PREFIX}/bin/conda" ]; then
|
||||
echo "Downloading Miniconda from $MINICONDA_DOWNLOAD_URL to ${INSTALL_DIR}/miniconda_installer.sh"
|
||||
mkdir -p "${INSTALL_DIR}"
|
||||
curl -L "${MINICONDA_DOWNLOAD_URL}" -o "${INSTALL_DIR}/miniconda_installer.sh"
|
||||
chmod +x "${INSTALL_DIR}/miniconda_installer.sh"
|
||||
bash "${INSTALL_DIR}/miniconda_installer.sh" -b -p "${CONDA_ROOT_PREFIX}"
|
||||
echo "Miniconda installed."
|
||||
fi
|
||||
|
||||
if [ ! -d "${INSTALL_ENV_DIR}" ]; then
|
||||
"${CONDA_ROOT_PREFIX}/bin/conda" create -y --prefix "${INSTALL_ENV_DIR}" -c conda-forge python=3.11.9
|
||||
echo "Conda environment created at ${INSTALL_ENV_DIR}."
|
||||
fi
|
||||
|
||||
# Activate the environment and install requirements
|
||||
source "${CONDA_ROOT_PREFIX}/etc/profile.d/conda.sh"
|
||||
conda activate "${INSTALL_ENV_DIR}"
|
||||
# pip install torch==2.2.1+cu121 torchaudio==2.2.1+cu121 --upgrade --force-reinstall --extra-index-url https://download.pytorch.org/whl/cu121 --no-cache-dir
|
||||
conda install -y pytorch=2.2.1 torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
|
||||
conda install -y nvidia/label/cuda-12.1.0::cuda-toolkit=12.1
|
||||
conda install -y pytorch::faiss-cpu
|
||||
conda install -y conda-forge::ffmpeg
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo " Fix Nvidia's broken symlinks in the /env/lib folder"
|
||||
echo
|
||||
# Define the environment path
|
||||
env_path="${INSTALL_ENV_DIR}/lib"
|
||||
|
||||
# List of broken symlinks and their correct targets
|
||||
declare -A symlinks=(
|
||||
["libcufile.so"]="libcufile.so.1.10.0"
|
||||
["libcufile_rdma.so"]="libcufile_rdma.so.1.10.0"
|
||||
["libcudart.so"]="libcudart.so.12"
|
||||
["libnvjpeg.so"]="libnvjpeg.so.12.1.1.14"
|
||||
["libcurand.so"]="libcurand.so.10.3.6.39"
|
||||
["libnvJitLink.so"]="libnvJitLink.so.12.1.105"
|
||||
["libnvrtc-builtins.so"]="libnvrtc-builtins.so.12.1.105"
|
||||
["libnvrtc.so"]="libnvrtc.so.12.1.105"
|
||||
)
|
||||
|
||||
# Function to fix broken symlinks
|
||||
fix_broken_symlinks() {
|
||||
echo "Fixing broken symlinks..."
|
||||
for link in "${!symlinks[@]}"; do
|
||||
target="${symlinks[$link]}"
|
||||
if [ -L "$env_path/$link" ] && [ ! -e "$env_path/$link" ]; then
|
||||
echo "Removing broken link: $env_path/$link"
|
||||
rm "$env_path/$link"
|
||||
fi
|
||||
|
||||
if [ -e "$env_path/$target" ]; then
|
||||
echo "Creating new symlink: $env_path/$link -> $env_path/$target"
|
||||
ln -s "$env_path/$target" "$env_path/$link"
|
||||
else
|
||||
echo "Target file does not exist: $env_path/$target"
|
||||
fi
|
||||
done
|
||||
echo "Verification of symbolic links:"
|
||||
ls -l $env_path | grep -E "libcufile.so|libcudart.so|libcufile_rdma.so|libnvjpeg.so|libcurand.so|libnvJitLink.so|libnvrtc-builtins.so|libnvrtc.so"
|
||||
}
|
||||
|
||||
# Call the function to fix broken symlinks
|
||||
fix_broken_symlinks
|
||||
echo " Installing additional requirements."
|
||||
echo
|
||||
pip install -r system/requirements/requirements_standalone.txt
|
||||
curl -LO https://github.com/erew123/alltalk_tts/releases/download/DeepSpeed-14.0/deepspeed-0.14.2+cu121torch2.2-cp311-cp311-manylinux_2_24_x86_64.whl
|
||||
pip install --upgrade gradio==4.32.2
|
||||
echo Installing DeepSpeed...
|
||||
pip install deepspeed-0.14.2+cu121torch2.2-cp311-cp311-manylinux_2_24_x86_64.whl
|
||||
rm deepspeed-0.14.2+cu121torch2.2-cp311-cp311-manylinux_2_24_x86_64.whl
|
||||
conda clean --all --force-pkgs-dirs -y
|
||||
Create start_environment.sh to run AllTalk
|
||||
cat << EOF > start_environment.sh
|
||||
#!/bin/bash
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
if [[ "$(pwd)" =~ " " ]]; then echo This script relies on Miniconda which can not be silently installed under a path with spaces. && exit; fi
|
||||
# deactivate existing conda envs as needed to avoid conflicts
|
||||
{ conda deactivate && conda deactivate && conda deactivate; } 2> /dev/null
|
||||
# config
|
||||
CONDA_ROOT_PREFIX="$(pwd)/alltalk_environment/conda"
|
||||
INSTALL_ENV_DIR="$(pwd)/alltalk_environment/env"
|
||||
# environment isolation
|
||||
export PYTHONNOUSERSITE=1
|
||||
unset PYTHONPATH
|
||||
unset PYTHONHOME
|
||||
export CUDA_PATH="$INSTALL_ENV_DIR"
|
||||
export CUDA_HOME="$CUDA_PATH"
|
||||
# activate env
|
||||
bash --init-file <(echo "source \"$CONDA_ROOT_PREFIX/etc/profile.d/conda.sh\" && conda activate \"$INSTALL_ENV_DIR\"")
|
||||
EOF
|
||||
cat << EOF > start_alltalk.sh
|
||||
#!/bin/bash
|
||||
source "${CONDA_ROOT_PREFIX}/etc/profile.d/conda.sh"
|
||||
conda activate "${INSTALL_ENV_DIR}"
|
||||
python script.py
|
||||
EOF
|
||||
cat << EOF > start_finetune.sh
|
||||
#!/bin/bash
|
||||
export TRAINER_TELEMETRY=0
|
||||
source "${CONDA_ROOT_PREFIX}/etc/profile.d/conda.sh"
|
||||
conda activate "${INSTALL_ENV_DIR}"
|
||||
python finetune.py
|
||||
EOF
|
||||
cat << EOF > start_diagnostics.sh
|
||||
#!/bin/bash
|
||||
source "${CONDA_ROOT_PREFIX}/etc/profile.d/conda.sh"
|
||||
conda activate "${INSTALL_ENV_DIR}"
|
||||
python diagnostics.py
|
||||
EOF
|
||||
chmod +x start_alltalk.sh
|
||||
chmod +x start_environment.sh
|
||||
chmod +x start_finetune.sh
|
||||
chmod +x start_diagnostics.sh
|
||||
echo
|
||||
echo
|
||||
echo -e " Run ${L_YELLOW}./start_alltalk.sh${NC} to start AllTalk."
|
||||
echo -e " Run ${L_YELLOW}./start_diagnostics.sh${NC} to start Diagnostics."
|
||||
echo -e " Run ${L_YELLOW}./start_finetune.sh${NC} to start Finetuning."
|
||||
echo -e " Run ${L_YELLOW}./start_environment.sh${NC} to start the AllTalk Python environment."
|
||||
echo
|
||||
echo -e " To install ${L_YELLOW}DeepSpeed${NC} on Linux, there are additional"
|
||||
echo -e " steps required. Please see the Github or documentation on DeepSeed."
|
||||
echo
|
||||
read -p " Press any key to continue. " -n 1
|
||||
}
|
||||
|
||||
delete_custom_standalone() {
|
||||
local env_dir="$PWD/alltalk_environment"
|
||||
# Check if the alltalk_environment directory exists
|
||||
if [ ! -d "$env_dir" ]; then
|
||||
echo " \"$env_dir\" directory does not exist. No need to delete."
|
||||
read -p " Press any key to continue. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
# Check if a Conda environment is active and deactivate it
|
||||
if [ -n "$CONDA_PREFIX" ]; then
|
||||
echo " Exiting the Conda environment. You may need to start ./atstart.sh again"
|
||||
conda deactivate
|
||||
fi
|
||||
echo "Deleting \"$env_dir\". Please wait."
|
||||
rm -rf "$env_dir"
|
||||
if [ -d "$env_dir" ]; then
|
||||
echo " Failed to delete \"$env_dir\" folder."
|
||||
echo " Please make sure it is not in use and try again."
|
||||
else
|
||||
echo " Environment \"$env_dir\" deleted successfully."
|
||||
fi
|
||||
read -p " Press any key to continue. " -n 1
|
||||
echo
|
||||
}
|
||||
|
||||
generate_diagnostics_standalone() {
|
||||
local env_dir="$PWD/alltalk_environment"
|
||||
local conda_root_prefix="${env_dir}/conda"
|
||||
local install_env_dir="${env_dir}/env"
|
||||
if [ ! -d "${install_env_dir}" ]; then
|
||||
echo
|
||||
echo " The Conda environment at '${install_env_dir}' does not exist."
|
||||
echo " Please install the environment before proceeding."
|
||||
echo
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
source "${conda_root_prefix}/etc/profile.d/conda.sh"
|
||||
conda activate "${install_env_dir}"
|
||||
if ! python diagnostics.py; then
|
||||
echo
|
||||
echo " There was an error running diagnostics."
|
||||
echo
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
echo
|
||||
echo " Diagnostics completed successfully."
|
||||
read -p " Press any key to continue. " -n 1
|
||||
echo
|
||||
}
|
||||
|
||||
gitpull_standalone() {
|
||||
local env_dir="$PWD/alltalk_environment"
|
||||
local conda_root_prefix="${env_dir}/conda"
|
||||
local install_env_dir="${env_dir}/env"
|
||||
if [ ! -d "${install_env_dir}" ]; then
|
||||
echo
|
||||
echo " The Conda environment at '${install_env_dir}' does not exist."
|
||||
echo " Please install the environment before proceeding."
|
||||
echo
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
source "${conda_root_prefix}/etc/profile.d/conda.sh"
|
||||
conda activate "${install_env_dir}"
|
||||
if ! git pull; then
|
||||
echo
|
||||
echo " There was an error pulling from Github."
|
||||
echo
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
echo
|
||||
echo " AllTalk Updated from Github. Please re-apply."
|
||||
echo " the latest requirements file. (Option 3)"
|
||||
echo
|
||||
read -p " Press any key to continue. " -n 1
|
||||
echo
|
||||
}
|
||||
|
||||
pippurge_standalone() {
|
||||
if ! pip cache purge; then
|
||||
echo
|
||||
echo " There was an error."
|
||||
echo
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
echo
|
||||
echo " The PIP cache has been purged."
|
||||
echo
|
||||
read -p " Press any key to continue. " -n 1
|
||||
echo
|
||||
}
|
||||
|
||||
reapply_standalone() {
|
||||
local env_dir="$PWD/alltalk_environment"
|
||||
local conda_root_prefix="${env_dir}/conda"
|
||||
local install_env_dir="${env_dir}/env"
|
||||
if [ ! -d "${install_env_dir}" ]; then
|
||||
echo
|
||||
echo " The Conda environment at '${install_env_dir}' does not exist."
|
||||
echo " Please install the environment before proceeding."
|
||||
echo
|
||||
read -p " Press any key to return to the menu. " -n 1
|
||||
echo
|
||||
return
|
||||
fi
|
||||
source "${conda_root_prefix}/etc/profile.d/conda.sh"
|
||||
conda activate "${install_env_dir}"
|
||||
echo
|
||||
echo " Downloading and installing PyTorch. This step can take a long time"
|
||||
echo " depending on your internet connection and hard drive speed. Please"
|
||||
echo " be patient."
|
||||
pip install torch>=2.2.1+cu121 torchaudio>=2.2.1+cu121 --upgrade --force-reinstall --extra-index-url https://download.pytorch.org/whl/cu121
|
||||
echo
|
||||
echo " Installing additional requirements."
|
||||
echo
|
||||
pip install -r system/requirements/requirements_standalone.txt
|
||||
echo
|
||||
echo " Requirements have been re-applied/updated."
|
||||
echo
|
||||
read -p " Press any key to continue. " -n 1
|
||||
echo
|
||||
}
|
||||
|
||||
|
||||
# Start the main menu
|
||||
main_menu
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"branding": "AllTalk ",
|
||||
"delete_output_wavs": "Disabled",
|
||||
"gradio_interface": true,
|
||||
"output_folder": "outputs",
|
||||
"gradio_port_number": 7852,
|
||||
"firstrun_model": true,
|
||||
"firstrun_splash": true,
|
||||
"launch_gradio": true,
|
||||
"transcode_audio_format": "Disabled",
|
||||
"theme": {
|
||||
"file": null,
|
||||
"class": "gradio/base"
|
||||
},
|
||||
"rvc_settings": {
|
||||
"rvc_enabled": false,
|
||||
"rvc_char_model_file": "Disabled",
|
||||
"rvc_narr_model_file": "Disabled",
|
||||
"split_audio": true,
|
||||
"autotune": false,
|
||||
"pitch": 0,
|
||||
"filter_radius": 3,
|
||||
"index_rate": 0.5,
|
||||
"rms_mix_rate": 1,
|
||||
"protect": 0.5,
|
||||
"hop_length": 79,
|
||||
"f0method": "fcpe",
|
||||
"embedder_model": "hubert",
|
||||
"training_data_size": 45000
|
||||
},
|
||||
"tgwui": {
|
||||
"tgwui_activate_tts": true,
|
||||
"tgwui_autoplay_tts": true,
|
||||
"tgwui_narrator_enabled": "false",
|
||||
"tgwui_non_quoted_text_is": "true",
|
||||
"tgwui_deepspeed_enabled": false,
|
||||
"tgwui_language": "English",
|
||||
"tgwui_lowvram_enabled": false,
|
||||
"tgwui_pitch_set": 0,
|
||||
"tgwui_temperature_set": 0.75,
|
||||
"tgwui_repetitionpenalty_set": 10,
|
||||
"tgwui_generationspeed_set": 1,
|
||||
"tgwui_narrator_voice": "female_01.wav",
|
||||
"tgwui_show_text": true,
|
||||
"tgwui_character_voice": "female_01.wav",
|
||||
"tgwui_rvc_char_voice": "Disabled",
|
||||
"tgwui_rvc_narr_voice": "Disabled"
|
||||
},
|
||||
"api_def": {
|
||||
"api_port_number": 7851,
|
||||
"api_allowed_filter": "[^a-zA-Z0-9\\s.,;:!?\\-\\'\"$\\u0400-\\u04FF\\u00C0-\\u00FF\\u0150\\u0151\\u0170\\u0171\\u0900-\\u097F\\u2018\\u2019\\u201C\\u201D\\u3001\\u3002\\u3040-\\u309F\\u30A0-\\u30FF\\u4E00-\\u9FFF\\u3400-\\u4DBF\\uF900-\\uFAFF\\u0600-\\u06FF\\u0750-\\u077F\\uFB50-\\uFDFF\\uFE70-\\uFEFF\\uAC00-\\uD7A3\\u1100-\\u11FF\\u3130-\\u318F\\uFF01\\uFF0c\\uFF1A\\uFF1B\\uFF1F]",
|
||||
"api_length_stripping": 3,
|
||||
"api_max_characters": 2000,
|
||||
"api_use_legacy_api": false,
|
||||
"api_legacy_ip_address": "127.0.0.1",
|
||||
"api_text_filtering": "standard",
|
||||
"api_narrator_enabled": "false",
|
||||
"api_text_not_inside": "character",
|
||||
"api_language": "en",
|
||||
"api_output_file_name": "myoutputfile",
|
||||
"api_output_file_timestamp": true,
|
||||
"api_autoplay": false,
|
||||
"api_autoplay_volume": 0.5
|
||||
},
|
||||
"debugging": {
|
||||
"debug_transcode": false,
|
||||
"debug_tts": false,
|
||||
"debug_openai": false,
|
||||
"debug_concat": false,
|
||||
"debug_tts_variables": false,
|
||||
"debug_rvc": false
|
||||
}
|
||||
}
|
||||
+335
@@ -0,0 +1,335 @@
|
||||
import platform
|
||||
import subprocess
|
||||
import logging
|
||||
from importlib_metadata import distributions
|
||||
import torch
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import glob
|
||||
import site
|
||||
import textwrap
|
||||
import packaging.version
|
||||
import packaging.specifiers
|
||||
from packaging.specifiers import SpecifierSet
|
||||
from packaging.version import parse as parse_version
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
import psutil
|
||||
except ImportError:
|
||||
print("psutil not found. Installing...")
|
||||
subprocess.run(['pip', 'install', 'psutil'])
|
||||
import psutil
|
||||
|
||||
def get_requirements_file():
|
||||
this_dir = Path(__file__).parent
|
||||
requirements_dir = this_dir / 'system' / 'requirements'
|
||||
requirements_files = list(requirements_dir.glob('requirements*.txt'))
|
||||
|
||||
if not requirements_files:
|
||||
print("\033[91mNo requirements files found.\033[0m")
|
||||
return None
|
||||
|
||||
print("\033[94m\n Select a requirements file to check against.")
|
||||
print("\033[94m Or press Enter for default 'requirements_standalone.txt'):\033[0m\n")
|
||||
for i, file_path in enumerate(requirements_files, start=1):
|
||||
print(f" {i}. {file_path.name}")
|
||||
|
||||
choice = input("\n Enter the number of your choice: ")
|
||||
try:
|
||||
choice = int(choice) - 1
|
||||
return str(requirements_files[choice])
|
||||
except (ValueError, IndexError):
|
||||
return str(requirements_dir / "requirements_standalone.txt")
|
||||
|
||||
logging.basicConfig(filename='diagnostics.log',
|
||||
filemode='w',
|
||||
level=logging.INFO,
|
||||
format='%(message)s')
|
||||
|
||||
def get_gpu_info():
|
||||
try:
|
||||
result = subprocess.run(['nvidia-smi'], stdout=subprocess.PIPE, text=True)
|
||||
return result.stdout
|
||||
except FileNotFoundError:
|
||||
return "NVIDIA GPU information not available"
|
||||
|
||||
def get_cpu_info():
|
||||
cpu_info = {
|
||||
'physical_cores': psutil.cpu_count(logical=False),
|
||||
'total_cores': psutil.cpu_count(logical=True),
|
||||
'max_frequency': psutil.cpu_freq().max
|
||||
}
|
||||
return cpu_info
|
||||
|
||||
def get_disk_info():
|
||||
disk_info = []
|
||||
partitions = psutil.disk_partitions()
|
||||
for p in partitions:
|
||||
usage = psutil.disk_usage(p.mountpoint)
|
||||
disk_info.append(f" Drive: {p.device} | Total: {usage.total / (1024 ** 3):.2f} GB | Used: {usage.used / (1024 ** 3):.2f} GB | Free: {usage.free / (1024 ** 3):.2f} GB | Type: {p.fstype}")
|
||||
return disk_info
|
||||
|
||||
def is_port_in_use(port):
|
||||
for conn in psutil.net_connections():
|
||||
if conn.laddr.port == port:
|
||||
return True
|
||||
return False
|
||||
|
||||
def satisfies_wildcard(installed_version, required_version):
|
||||
if '*' in required_version:
|
||||
required_parts = required_version.split('.')
|
||||
installed_parts = installed_version.split('.')
|
||||
for req, inst in zip(required_parts, installed_parts):
|
||||
if req != '*' and req != inst:
|
||||
return False
|
||||
return True
|
||||
return False
|
||||
|
||||
def test_cuda():
|
||||
cuda_available = torch.cuda.is_available()
|
||||
if cuda_available:
|
||||
try:
|
||||
torch.tensor([1.0, 2.0]).cuda()
|
||||
return "Success - CUDA is available and working."
|
||||
except Exception as e:
|
||||
return f"Fail - CUDA is available but not working. Error: {e}"
|
||||
else:
|
||||
return "Fail - CUDA is not available."
|
||||
|
||||
def get_cuda_details():
|
||||
if torch.cuda.is_available():
|
||||
device_id = torch.cuda.current_device()
|
||||
device_name = torch.cuda.get_device_name(device_id)
|
||||
device_memory = torch.cuda.get_device_properties(device_id).total_memory / (1024 ** 3)
|
||||
cuda_version = torch.version.cuda
|
||||
return device_name, device_memory, cuda_version
|
||||
else:
|
||||
return None, None, None
|
||||
|
||||
def find_files_in_path_with_wildcard(pattern):
|
||||
site_packages_path = site.getsitepackages()
|
||||
found_paths = []
|
||||
sub_directory = "nvidia/cublas"
|
||||
if platform.system() == "Linux":
|
||||
sub_directory = os.path.join(sub_directory, "lib")
|
||||
else:
|
||||
sub_directory = os.path.join(sub_directory, "bin")
|
||||
for directory in site_packages_path:
|
||||
search_directory = os.path.join(directory, sub_directory)
|
||||
for file_path in glob.glob(os.path.join(search_directory, pattern)):
|
||||
if os.path.isfile(file_path):
|
||||
found_paths.append(file_path)
|
||||
return found_paths
|
||||
|
||||
def log_system_info():
|
||||
os_version = platform.system() + " " + platform.version()
|
||||
cuda_home = os.environ.get('CUDA_HOME', 'N/A')
|
||||
gpu_info = get_gpu_info()
|
||||
python_version = platform.python_version()
|
||||
torch_version = torch.__version__
|
||||
cuda_test_result = test_cuda()
|
||||
cuda_device_name, cuda_device_memory, cuda_version = get_cuda_details()
|
||||
cpu_info = get_cpu_info()
|
||||
disk_info = get_disk_info()
|
||||
|
||||
try:
|
||||
virtual_memory = psutil.virtual_memory()
|
||||
total_ram = f"{virtual_memory.total / (1024 ** 3):.2f} GB"
|
||||
available_ram = f"{virtual_memory.available / (1024 ** 3):.2f} GB"
|
||||
system_ram = f"{available_ram} available out of {total_ram} total"
|
||||
except NameError:
|
||||
print("psutil is not installed. Unable to check system RAM.")
|
||||
system_ram = "N/A"
|
||||
|
||||
port_status = "N/A"
|
||||
if 'psutil' in globals():
|
||||
port_to_check = 7851
|
||||
if is_port_in_use(port_to_check):
|
||||
port_status = f"Port {port_to_check} is in use."
|
||||
else:
|
||||
port_status = f"Port {port_to_check} is available."
|
||||
|
||||
package_versions = {d.metadata['Name']: d.version for d in distributions()}
|
||||
python_executable = sys.executable
|
||||
python_version_info = sys.version_info
|
||||
python_virtual_env = os.environ.get('VIRTUAL_ENV', 'N/A')
|
||||
conda_env = os.environ.get('CONDA_DEFAULT_ENV', 'N/A')
|
||||
search_path = sys.path
|
||||
path_env = os.environ.get('PATH', 'N/A')
|
||||
file_name = 'cublas64_11.*' if platform.system() == "Windows" else 'libcublas.so.11*'
|
||||
found_paths = find_files_in_path_with_wildcard(file_name)
|
||||
requirements_file = get_requirements_file()
|
||||
|
||||
if requirements_file:
|
||||
required_packages = {}
|
||||
installed_packages = {}
|
||||
try:
|
||||
with open(requirements_file, 'r') as req_file:
|
||||
requirements = [line.strip() for line in req_file]
|
||||
for req in requirements:
|
||||
if ';' in req:
|
||||
continue # Skip OS-specific requirements
|
||||
match = re.match(r'([^\s>=]+)\s*([>=<]+)\s*([^,]+)', req)
|
||||
if match:
|
||||
package_name, operator, version_spec = match.groups()
|
||||
installed_version = package_versions.get(package_name, 'Not installed')
|
||||
if installed_version != 'Not installed':
|
||||
required_packages[package_name] = (operator, version_spec)
|
||||
installed_packages[package_name] = installed_version
|
||||
except FileNotFoundError:
|
||||
print(f"\n{requirements_file} not found. Skipping version checks.")
|
||||
logging.info(f"NOTE {requirements_file} not found. Skipping version checks.")
|
||||
|
||||
logging.info(f"OPERATING SYSTEM:")
|
||||
logging.info(f" OS Version: {os_version}")
|
||||
logging.info(f" Note: Windows 11 will list as build is 10.x.22xxx")
|
||||
logging.info(f"\nHARDWARE ENVIRONMENT:")
|
||||
logging.info(f" CPU: Physical Cores: {cpu_info['physical_cores']}, Total Cores: {cpu_info['total_cores']}, Max Frequency: {cpu_info['max_frequency']} MHz")
|
||||
logging.info(f" System RAM: {system_ram}")
|
||||
logging.info(f"\nGPU INFORMATION:")
|
||||
logging.info(f" {gpu_info}")
|
||||
logging.info(f" CUDA Device : {cuda_device_name}")
|
||||
logging.info(f" CUDA Memory : {cuda_device_memory:.2f} GB")
|
||||
logging.info(f" CUDA Version: {cuda_version}")
|
||||
logging.info("DISK INFORMATION:")
|
||||
for disk in disk_info:
|
||||
logging.info(disk)
|
||||
logging.info("\nNETWORK PORT:")
|
||||
logging.info(f" Port Status : {port_status}")
|
||||
logging.info("\nCUDA :")
|
||||
logging.info(f" CUDA Working: {cuda_test_result}")
|
||||
logging.info(f" CUDA_HOME : {cuda_home}")
|
||||
if found_paths:
|
||||
logging.info(f" Cublas64_11 Path: {', '.join(found_paths)}")
|
||||
else:
|
||||
logging.info(f" Cublas64_11 Path: Not found in any search path directories.")
|
||||
logging.info("\nPYTHON & PYTORCH:")
|
||||
logging.info(f" Torch Version: {torch_version}")
|
||||
logging.info(f" Python Version: {python_version}")
|
||||
logging.info(f" Python Version Info: {python_version_info}")
|
||||
logging.info(f" Python Executable: {python_executable}")
|
||||
logging.info(f" Python Virtual Environment: {python_virtual_env} (Should be N/A when in Text-generation-webui Conda Python environment)")
|
||||
logging.info(f" Conda Environment: {conda_env}")
|
||||
logging.info("\nPython Search Path:")
|
||||
for path in search_path:
|
||||
logging.info(f" {path}")
|
||||
logging.info("\nOS SEARCHPATH ENVIRONMENT:")
|
||||
for path in path_env.split(';'):
|
||||
logging.info(f" {path}")
|
||||
|
||||
if required_packages:
|
||||
logging.info("\nPACKAGE VERSIONS vs REQUIREMENTS FILE:")
|
||||
max_package_length = max(len(package) for package in required_packages.keys())
|
||||
for package_name, (operator, required_version) in required_packages.items():
|
||||
installed_version = installed_packages.get(package_name, 'Not installed')
|
||||
logging.info(f" {package_name.ljust(max_package_length)} Required: {operator} {required_version.ljust(12)} Installed: {installed_version}")
|
||||
|
||||
logging.info("\nPYTHON PACKAGES:")
|
||||
for package, version in package_versions.items():
|
||||
logging.info(f" {package}>= {version}")
|
||||
|
||||
deepspeed_requirements = (
|
||||
f"\nDeepSpeed Installation Requirements:\n"
|
||||
f" OS : {platform.system()}\n"
|
||||
f" Python : {python_version}\n"
|
||||
f" PyTorch: {torch_version}\n"
|
||||
f" CUDA : {'N/A' if not cuda_version else cuda_version}\n"
|
||||
f"\nTo install DeepSpeed, run the following command based on your environment:"
|
||||
f"\n pip install deepspeed==<version> --no-cache-dir"
|
||||
f"\nEnsure to choose the correct DeepSpeed version matching your environment."
|
||||
)
|
||||
|
||||
logging.info(deepspeed_requirements)
|
||||
|
||||
print(f"\n\033[94mOS Version:\033[0m \033[92m{os_version}\033[0m")
|
||||
print(f"\033[94mOS Ver note:\033[0m \033[92m(Windows 11 will say build is 10.x.22xxx)\033[0m")
|
||||
print(f"\033[94mSystem RAM:\033[0m \033[92m{system_ram}\033[0m")
|
||||
for disk in disk_info:
|
||||
print(f"\033[94mDisk:\033[0m \033[92m{disk}\033[0m")
|
||||
print(f"\033[94m\nGPU Information:\033[0m {gpu_info}")
|
||||
print(f"\033[94mPort Status :\033[0m \033[92m{port_status}\033[0m")
|
||||
print(f"\033[0m\n If this network port is unavailable because something else is using it, your")
|
||||
print(f"\033[0m firewall or antivirus is blocking it, AllTalk will fail to start.")
|
||||
print(f"\n\033[94mCUDA Device :\033[0m \033[92m{cuda_device_name}\033[0m")
|
||||
print(f"\033[94mCUDA Memory :\033[0m \033[92m{cuda_device_memory:.2f} GB\033[0m")
|
||||
print(f"\033[94mCUDA Version:\033[0m \033[92m{cuda_version}\033[0m")
|
||||
if "Fail" in cuda_test_result:
|
||||
print(f"\033[91mCUDA Working:\033[0m \033[91m{cuda_test_result}\033[0m")
|
||||
else:
|
||||
print(f"\033[94mCUDA Working:\033[0m \033[92m{cuda_test_result}\033[0m")
|
||||
print(f"\033[94mCUDA_HOME :\033[0m \033[92m{cuda_home}\033[0m")
|
||||
if found_paths:
|
||||
print(f"\033[94mCublas64_11 :\033[0m \033[92m{', '.join(found_paths)}\033[0m")
|
||||
else:
|
||||
print(f"\033[94mCublas64_11 :\033[0m \033[91mNot found in any search path directories.\033[0m")
|
||||
print(f"\033[0m\n If you do not have a CUDA version and CUDA is failing, you will not have your")
|
||||
print(f"\033[0m TTS engines being accelerated with CUDA. CUDA is only available on Nvidia GPU")
|
||||
print(f"\033[0m and is setup by installing PyTorch with a correct CUDA version in your Python")
|
||||
print(f"\033[0m virtual environment.")
|
||||
print(f"\033[94m\nPyTorch Version :\033[0m \033[92m{torch_version}\033[0m")
|
||||
print(f"\033[94mPython Version :\033[0m \033[92m{platform.python_version()}\033[0m")
|
||||
print(f"\033[94mPython Executable:\033[0m \033[92m{python_executable}\033[0m")
|
||||
print(f"\033[0m\n AllTalk has been validated to run on Python 3.11.x versions and also PyTorch")
|
||||
print(f"\033[0m 2.0.x to 2.2.x. Earlier or later versions of PyTorch and Python may not work.")
|
||||
print(f"\033[94m\nConda Environment:\033[0m \033[92m{conda_env}\033[0m")
|
||||
print(f"\n\033[94mPython Search Path:\033[0m")
|
||||
for path in search_path:
|
||||
print(f" {path}")
|
||||
print(f"\033[0m\n If you are correctly in the AllTalk Python virtual environment, you will")
|
||||
print(f"\033[0m expect to see 'alltalk_environment' as part of the path of the above folders.")
|
||||
print(f"\033[0m If you are running AllTalk as part of Text-generation-webui, you should see ")
|
||||
print(f"\033[0m 'text-generation-webui' listed in the path of the above folders. If you dont")
|
||||
print(f"\033[0m see them mentioned, you have probably not started the correct Python virtual")
|
||||
print(f"\033[0m environment.")
|
||||
if required_packages:
|
||||
print("\033[94m\nRequirements file package comparison:\033[0m")
|
||||
max_package_length = max(len(package) for package in required_packages.keys())
|
||||
|
||||
for package_name, (operator, required_version) in required_packages.items():
|
||||
installed_version = installed_packages.get(package_name, 'Not installed')
|
||||
required_version_no_build = required_version.split("+")[0]
|
||||
|
||||
if '*' in required_version:
|
||||
condition_met = satisfies_wildcard(installed_version, required_version)
|
||||
else:
|
||||
required_specifier = SpecifierSet(f"{operator}{required_version_no_build}")
|
||||
installed_version = parse_version(installed_version)
|
||||
condition_met = installed_version in required_specifier
|
||||
|
||||
color_required = "\033[92m" if condition_met else "\033[91m"
|
||||
color_installed = "\033[92m" if condition_met else "\033[91m"
|
||||
|
||||
print(f" {package_name.ljust(max_package_length)} Required: {color_required}{operator} {required_version.ljust(12)}\033[0m Installed: {color_installed}{installed_version}\033[0m")
|
||||
|
||||
print("\033[94m\nRequirements file specifier meanings:\033[0m")
|
||||
explanation = textwrap.dedent("""
|
||||
== Exact version != Any version except < Less than
|
||||
<= Less than or equal to > Greater than >= Greater/equal to
|
||||
~ Compatible release ; Environment marker AND Logical AND
|
||||
OR Logical OR
|
||||
""")
|
||||
print(explanation.strip())
|
||||
|
||||
print(f"\033[94m\nDeepSpeed Installation Requirements:\033[0m")
|
||||
print("\n DeepSpeed is HIGHLY specific. It MUST be compiled for the correct major")
|
||||
print(" revision of Python (e.g. 3.11.x), PyTorch (e.g. 2.2.x), and the CUDA version")
|
||||
print(" that your PyTorch is using (e.g. 11.8 or 12.1). If any of these three")
|
||||
print(" components change version number (e.g. you update to PyTorch 2.3.x or Python")
|
||||
print(" 3.12.x), you will need to uninstall DeepSpeed and install a build that matches")
|
||||
print(" your new Python environment.")
|
||||
print("\n Here are the details of your current Python environment:")
|
||||
print(f" OS: \033[92m{platform.system()}\033[0m Python: \033[92m{python_version}\033[0m PyTorch: \033[92m{torch_version}\033[0m CUDA: \033[92m{'N/A' if not cuda_version else cuda_version}\033[0m")
|
||||
print("\n Therefore, you would need a DeepSpeed build for the above configuration. If")
|
||||
print(" you change ANY of the versions, remember to reinstall DeepSpeed to ensure")
|
||||
print(" compatibility with your updated environment. If the copy of DeepSpeed you have")
|
||||
print(" is NOT built to match the above, it will error/fail/crash etc.\n\n")
|
||||
print(f"\033[94mA diagnostic log file called \033[92mdiagnostics.log\033[94m has been created in the AllTalk")
|
||||
print(f"\033[94mfolder. Up above, on SCREEN you can read a few sections to help you diagnose\033[0m")
|
||||
print(f"\033[94many possible problems with your configuration or setup. So please take the\033[0m")
|
||||
print(f"\033[94mtime to check them. \033[0m")
|
||||
print(f"\033[94m\nIf you are going to ask for support, please upload the \033[92mdiagnostics.log\033[94m file.\033[0m")
|
||||
|
||||
if __name__ == "__main__":
|
||||
log_system_info()
|
||||
+1797
File diff suppressed because it is too large.
Load diff
+1676
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Reference in new issue
Block a user