upgraded xtts

This commit is contained in:
Saifeddine ALOUI 2024-01-29 20:07:26 +01:00
parent dd54bcecd7
commit f95c2349fa
2 changed files with 40 additions and 26 deletions

View File

@ -1,21 +1,10 @@
@echo off
setlocal
:: Check if system-wide Conda is installed
where conda >nul 2>&1
:: Check if portable Conda is installed
where installer_files\miniconda3\Scripts\activate.bat >nul 2>&1
if %errorlevel% == 0 (
echo "Using system-wide Conda installation."
call conda deactivate
call conda info --envs | findstr /B /C:"xtts" >nul 2>&1
if %errorlevel% == 0 (
echo "Conda environment 'xtts' already exists. Deleting it."
call conda env remove --name xtts --yes
)
call conda create --name xtts --yes
call conda activate xtts
call pip install xtts-api-server --user
) else (
echo "No system-wide Conda found. Using portable Conda installation."
echo "Using portable Conda installation."
set CONDA_BASE=installer_files\miniconda3
call "%CONDA_BASE%\Scripts\activate.bat"
call "%CONDA_BASE%\condabin\conda.bat" deactivate
@ -27,5 +16,23 @@ if %errorlevel% == 0 (
call "%CONDA_BASE%\condabin\conda.bat" create --name xtts --yes
call "%CONDA_BASE%\Scripts\activate.bat" xtts
call "%CONDA_BASE%\Scripts\pip.exe" install xtts-api-server --user
) else (
echo "No portable Conda found. Checking for system-wide Conda installation."
where conda >nul 2>&1
if %errorlevel% == 0 (
echo "Using system-wide Conda installation."
call conda deactivate
call conda info --envs | findstr /B /C:"xtts" >nul 2>&1
if %errorlevel% == 0 (
echo "Conda environment 'xtts' already exists. Deleting it."
call conda env remove --name xtts --yes
)
call conda create --name xtts --yes
call conda activate xtts
call pip install xtts-api-server --user
) else (
echo "No Conda installation found. Please install Conda."
exit /b 1
)
)
exit /b

View File

@ -1,19 +1,26 @@
@echo off
setlocal
:: Check if system-wide Conda is installed
where conda >nul 2>&1
:: Check if portable Conda is installed
where installer_files\miniconda3\Scripts\activate.bat >nul 2>&1
if %errorlevel% == 0 (
echo "Using system-wide Conda installation."
call conda activate xtts
python -m xtts_api_server -o %1 -sf %2
echo "Using portable Conda installation."
set CONDA_BASE=installer_files\miniconda3
call "%CONDA_BASE%\Scripts\activate.bat" xtts
call "%CONDA_BASE%\python.exe" -m xtts_api_server -o %1 -sf %2
call "%CONDA_BASE%\Scripts\deactivate.bat"
exit /b
) else (
echo "No portable Conda found. Checking for system-wide Conda installation."
where conda >nul 2>&1
if %errorlevel% == 0 (
echo "Using system-wide Conda installation."
call conda activate xtts
python -m xtts_api_server -o %1 -sf %2
exit /b
) else (
echo "No Conda installation found. Please install Conda."
exit /b 1
)
)
:: Use portable Conda if system-wide installation is not found
echo "No system-wide Conda found. Using portable Conda installation."
set CONDA_BASE=installer_files\miniconda3
call "%CONDA_BASE%\Scripts\activate.bat" xtts
call "%CONDA_BASE%\python.exe" -m xtts_api_server -o %1 -sf %2
call "%CONDA_BASE%\Scripts\deactivate.bat"
exit /b