File size: 2,496 Bytes
cc17cd1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@echo off
REM ─────────────────────────────────────────────────────────────────────────────
REM  NeuTTS-AIR Launcher
REM ─────────────────────────────────────────────────────────────────────────────

REM Set Hugging Face cache directory to local drive to avoid C: drive space issues
set HF_HOME=%~dp0\.hf_cache
set HUGGINGFACE_HUB_CACHE=%~dp0\.hf_cache\hub

REM Create cache directories if they don't exist
if not exist "%~dp0\.hf_cache" mkdir "%~dp0\.hf_cache"
if not exist "%~dp0\.hf_cache\hub" mkdir "%~dp0\.hf_cache\hub"

REM Configure PyTorch CUDA memory allocator to reduce fragmentation
set PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True

REM Suppress Hugging Face symlink warnings on Windows
set HF_HUB_DISABLE_SYMLINKS_WARNING=1

REM ─────────────────────────────────────────────────────────────────────────────
REM  Kill any leftover NeuTTS / Gradio process on ports 7860-7900
REM ─────────────────────────────────────────────────────────────────────────────
echo Checking for existing NeuTTS instances...
for /L %%P in (7860,1,7900) do (
    for /f "tokens=5" %%a in ('netstat -ano 2^>nul ^| findstr /R ":%%P.*LISTENING"') do (
        echo   Killing process %%a on port %%P
        taskkill /PID %%a /F >nul 2>&1
    )
)
echo Done.
echo.

echo Hugging Face cache : %HF_HOME%
echo CUDA alloc conf    : %PYTORCH_CUDA_ALLOC_CONF%
echo.

REM ─────────────────────────────────────────────────────────────────────────────
REM  Launch app
REM ─────────────────────────────────────────────────────────────────────────────
cd /d "%~dp0"
.venv\python.exe app.py
pause