This commit is contained in:
unknown
2025-06-17 07:00:07 -07:00
parent f68682d3e1
commit 56af24700d
4 changed files with 5 additions and 3 deletions

1
app.py
View File

@@ -74,6 +74,7 @@ def check_and_install_requirements(file_path):
msg = '\nInstalling missing packages...\n'
print(msg)
os.environ['TMPDIR'] = tmp_dir
result = subprocess.call([sys.executable, '-m', 'pip', 'cache', 'purge'])
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--upgrade', 'pip'])
with tqdm(total=len(packages), desc='Installation 0.00%', bar_format='{desc}: {n_fmt}/{total_fmt} ', unit='step') as t:
for package in tqdm(missing_packages, desc="Installing", unit="pkg"):

View File

@@ -221,6 +221,7 @@ if "%SCRIPT_MODE%"=="%FULL_DOCKER%" (
call conda create --prefix "%SCRIPT_DIR%\%PYTHON_ENV%" python=%PYTHON_VERSION% -y
call %CONDA_ENV% activate base
call conda activate "%SCRIPT_DIR%\%PYTHON_ENV%"
call python -m pip cache purge >nul 2>&1
call python -m pip install --upgrade pip
for /f "usebackq delims=" %%p in ("requirements.txt") do (
echo Installing %%p...

View File

@@ -301,13 +301,13 @@ else
conda init > /dev/null 2>&1
source $CONDA_ENV
conda activate "$SCRIPT_DIR/$PYTHON_ENV"
python -m pip cache purge > /dev/null 2>&1
python -m pip install --upgrade pip
python -m pip install --upgrade --no-cache-dir --use-pep517 --progress-bar=on < requirements.txt
tts_version=$(python -c "import importlib.metadata; print(importlib.metadata.version('coqui-tts'))" 2>/dev/null)
if [[ -n "$tts_version" ]]; then
if [[ "$(printf '%s\n' "$tts_version" "0.26.1" | sort -V | tail -n1)" == "0.26.1" ]]; then
python -m pip uninstall transformers
python -m pip cache purge
python -m install 'transformers<=4.51.3'
fi
fi

View File

@@ -180,7 +180,6 @@ class Coqui:
print(msg)
return tts
else:
gc.collect()
error = 'TTS engine could not be created!'
print(error)
except Exception as e:
@@ -245,7 +244,6 @@ class Coqui:
print(msg)
return tts
else:
gc.collect()
error = 'TTS engine could not be created!'
print(error)
except Exception as e:
@@ -430,10 +428,12 @@ class Coqui:
if tts_key is not None:
if tts_key in loaded_tts.keys():
del loaded_tts[tts_key]
gc.collect()
else:
for key in list(loaded_tts.keys()):
if key != self.tts_vc_key and key != self.tts_key:
del loaded_tts[key]
gc.collect()
if device != 'cpu':
torch.cuda.empty_cache()
torch.cuda.synchronize()