Merge pull request #24 from deffcolony/main

This commit is contained in:
Cohee
2023-12-12 13:47:06 +02:00
committed by GitHub
3 changed files with 47 additions and 12 deletions

View File

@@ -212,7 +212,7 @@ echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Extras launched in a
REM read modules.txt and find the start_command line
for /F "tokens=*" %%a in ('findstr /I "start_command=" %modules_path%') do (
set start_command=%%a
set %%a
)
set start_command=%start_command:start_command=%
@@ -243,11 +243,9 @@ call conda activate extras
REM Start SillyTavern Extras with desired configurations
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Extras launched in a new window.
@REM echo "Getting start command from modules.txt"
REM read modules.txt and find the start_command line
for /F "tokens=*" %%a in ('findstr /I "start_command=" %modules_path%') do (
set start_command=%%a
set %%a
)
set start_command=%start_command:start_command=%
@@ -723,9 +721,9 @@ echo Choose extras modules to enable or disable (e.g., "1 2 4" to enable Cuda, R
REM color 7
REM Display module options with colors based on their status
call :printModule "1. Cuda (--gpu 0 --cuda --cuda-device=0)" %cuda_trigger%
call :printModule "1. Cuda (--cuda)" %cuda_trigger%
call :printModule "2. RVC (--enable-modules=rvc --rvc-save-file --max-content-length=1000)" %rvc_trigger%
call :printModule "3. talkinghead (--enable-modules=talkinghead)" %talkinghead_trigger%
call :printModule "3. talkinghead (--enable-modules=talkinghead --talkinghead-gpu)" %talkinghead_trigger%
call :printModule "4. caption (--enable-modules=caption)" %caption_trigger%
call :printModule "5. summarize (--enable-modules=summarize)" %summarize_trigger%
call :printModule "6. listen (--listen)" %listen_trigger%
@@ -800,13 +798,14 @@ if "%listen_trigger%"=="true" (
set "python_command=%python_command% --listen"
)
if "%cuda_trigger%"=="true" (
set "python_command=%python_command% --gpu 0 --cuda --cuda-device=0 "
set "python_command=%python_command% --cuda"
)
if "%rvc_trigger%"=="true" (
set "python_command=%python_command% --rvc-save-file --max-content-length=1000"
set "modules_enable=%modules_enable%rvc,"
)
if "%talkinghead_trigger%"=="true" (
set "python_command=%python_command% --talkinghead-gpu"
set "modules_enable=%modules_enable%talkinghead,"
)
if "%caption_trigger%"=="true" (

40
install.sh Normal file → Executable file
View File

@@ -141,7 +141,31 @@ log_message() {
;;
esac
}
boxDrawingText()
{
local string=$1
local maxwidth=$2
# empty string
local color=
if [ $# -eq 3 ]; then
color=$3
fi
local stringlength=${#string}
# stringlength < maxwidth ? maxwidth : stringlength
local width=$((stringlength < maxwidth ? maxwidth : stringlength))
local topL="╔"
local bottomL="╚"
local topR="╗"
local bottomR="╝"
local middle="║"
local space=" "
echo -e "$color$middle$string$(printf ' %.0s' $(seq 1 $((width - stringlength))))$middle"
}
# Log your messages test window
#log_message "INFO" "Something has been launched."
#log_message "WARN" "${yellow_fg_strong}Something is not installed on this system.${reset}"
@@ -350,6 +374,7 @@ install_st_extras() {
# Install pip requirements
log_message "INFO" "Installing pip requirements for xtts..."
pip install xtts-api-server
pip install pydub
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
# Create folders for xtts
@@ -407,6 +432,7 @@ install_st_extras() {
# Install pip requirements
log_message "INFO" "Installing modules from requirements.txt in extras..."
pip install -r requirements.txt
conda install -c conda-forge faiss-gpu -y
elif [ "$gpu_choice" == "2" ]; then
log_message "INFO" "Installing modules from requirements-rocm.txt in extras..."
pip install -r requirements-rocm.txt
@@ -420,6 +446,7 @@ install_st_extras() {
log_message "INFO" "Installing pip requirements-rvc in extras environment..."
pip install -r requirements-rvc.txt
pip install tensorboardX
# Cleanup the Downloaded file
rm -rf /tmp/$miniconda_installer
@@ -581,6 +608,7 @@ install_extras() {
# Install pip requirements
log_message "INFO" "Installing pip requirements for xtts..."
pip install xtts-api-server
pip install pydub
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
# Create folders for xtts
@@ -623,11 +651,11 @@ install_extras() {
done < <(lspci | grep VGA | cut -d ':' -f3)
echo ""
echo -e "${blue_bg}╔════ GPU INFO ═════════════════════════════════╗${reset}"
echo -e "${blue_bg}║ ║${reset}"
echo -e "${blue_bg}║* ${gpu_info:1}${reset}"
echo -e "${blue_bg}║ ║${reset}"
echo -e "${blue_bg}╚═══════════════════════════════════════════════╝${reset}"
echo -e "${blue_bg}╔════ GPU INFO ═════════════════════════════════════════════════════════════${reset}"
boxDrawingText "" 75 $blue_bg
boxDrawingText "* ${gpu_info:1}" 75 $blue_bg
boxDrawingText "" 75 $blue_bg
echo -e "${blue_bg}╚═══════════════════════════════════════════════════════════════════════════${reset}"
echo ""
# Prompt for GPU choice
@@ -638,6 +666,7 @@ install_extras() {
# Install pip requirements
log_message "INFO" "Installing modules from requirements.txt in extras..."
pip install -r requirements.txt
conda install -c conda-forge faiss-gpu -y
elif [ "$gpu_choice" == "2" ]; then
log_message "INFO" "Installing modules from requirements-rocm.txt in extras..."
pip install -r requirements-rocm.txt
@@ -651,6 +680,7 @@ install_extras() {
log_message "INFO" "Installing pip requirements-rvc in extras environment..."
pip install -r requirements-rvc.txt
pip install tensorboardX
# Cleanup the Downloaded file
rm -rf /tmp/$miniconda_installer

View File

@@ -247,6 +247,7 @@ if /i "%install_xtts_requirements%"=="Y" (
REM Install pip requirements
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing pip requirements for xtts...
pip install xtts-api-server
pip install pydub
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
REM Create folders for xtts
@@ -305,6 +306,7 @@ if "%gpu_choice%"=="1" (
REM Install pip requirements
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing modules from requirements.txt in extras
pip install -r requirements.txt
call conda install -c conda-forge faiss-gpu -y
) else if "%gpu_choice%"=="2" (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing modules from requirements-rocm.txt in extras
pip install -r requirements-rocm.txt
@@ -320,6 +322,7 @@ if "%gpu_choice%"=="1" (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing pip requirements-rvc in extras environment...
pip install -r requirements-rvc.txt
pip install tensorboardX
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%Extras installed successfully.%reset%
@@ -334,6 +337,7 @@ if /i "%create_shortcut%"=="Y" (
"$WshShell = New-Object -ComObject WScript.Shell; " ^
"$Shortcut = $WshShell.CreateShortcut('%desktopPath%\%shortcutName%'); " ^
"$Shortcut.TargetPath = '%shortcutTarget%'; " ^
"$Shortcut.IconLocation = '%iconFile%'; " ^
"$Shortcut.WorkingDirectory = '%startIn%'; " ^
"$Shortcut.Description = '%comment%'; " ^
"$Shortcut.Save()"
@@ -548,6 +552,7 @@ if "%gpu_choice%"=="1" (
REM Install pip requirements
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing modules from requirements.txt in extras
pip install -r requirements.txt
call conda install -c conda-forge faiss-gpu -y
) else if "%gpu_choice%"=="2" (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing modules from requirements-rocm.txt in extras
pip install -r requirements-rocm.txt
@@ -563,6 +568,7 @@ if "%gpu_choice%"=="1" (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing pip requirements-rvc in extras environment...
pip install -r requirements-rvc.txt
pip install tensorboardX
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%Extras installed successfully.%reset%