-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.bat
More file actions
136 lines (122 loc) · 3.5 KB
/
Copy pathrun.bat
File metadata and controls
136 lines (122 loc) · 3.5 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
@echo off
setlocal enabledelayedexpansion
echo ===================================================
echo HUSHCORE VOICE INITIALIZER
echo ===================================================
cd /d "%~dp0"
:: Check for Node.js
where node >nul 2>nul
if errorlevel 1 (
echo [ERROR] Node.js is not installed or not in PATH.
echo Please download and install Node.js from https://nodejs.org/
echo.
pause
exit /b 1
)
:: Check for Python
where python >nul 2>nul
if errorlevel 1 (
echo [ERROR] Python is not installed or not in PATH.
echo Please install Python and ensure "Add Python to PATH" is checked during setup.
echo.
pause
exit /b 1
)
:: Build frontend
echo.
echo [1/3] Building frontend assets...
if not exist "frontend" (
echo [ERROR] 'frontend' folder not found in the current directory: %cd%
pause
exit /b 1
)
cd frontend
if not exist "node_modules" (
echo node_modules not found, running npm install...
call npm install
if errorlevel 1 (
echo [ERROR] npm install failed.
pause
exit /b 1
)
)
echo Compiling Vite application...
call npm run build
if errorlevel 1 (
echo [ERROR] Vite compilation failed.
pause
exit /b 1
)
cd ..
:: Setup Python Virtual Environment
echo.
echo [2/3] Preparing Python environment...
if not exist "venv" (
echo Creating Python virtual environment - venv...
python -m venv venv
if errorlevel 1 (
echo [ERROR] Failed to create virtual environment.
pause
exit /b 1
)
)
echo Activating virtual environment...
if not exist "venv\Scripts\activate.bat" (
echo [ERROR] Virtual environment activation script not found.
pause
exit /b 1
)
call venv\Scripts\activate.bat
echo Upgrading pip...
python -m pip install --upgrade pip
echo Installing core dependencies...
pip install -r backend\requirements.txt
if errorlevel 1 (
echo [ERROR] Failed to install Python dependencies from backend\requirements.txt.
pause
exit /b 1
)
:: Ask user if they want to install PyTorch + DeepFilterNet
echo.
echo ===================================================
echo OPTIONAL: DeepFilterNet AI Engine Setup
echo ===================================================
echo Our app runs with a lightweight built-in Eco DSP Noise Suppression.
echo However, to enable the High-Quality AI engine (DeepFilterNet),
echo you can install PyTorch, torchaudio, and deepfilternet.
echo Note: This requires about 1.5GB of disk space.
echo.
set /p install_ai="Do you want to install the HQ AI components now? (y/n): "
if /i "%install_ai%"=="y" (
echo Installing PyTorch CPU and torchaudio...
pip install torch torchaudio --index-url https://download.pytorch.org/whl/cpu
if errorlevel 1 (
echo [WARNING] Failed to install PyTorch. Skipping AI component setup.
) else (
echo Installing DeepFilterNet...
pip install deepfilternet
if errorlevel 1 (
echo [WARNING] Failed to install DeepFilterNet. Skipping AI component setup.
)
)
) else (
echo Skipping HQ AI components. Running in Eco DSP mode.
)
:: Launch App
echo.
echo [3/3] Starting HushCore backend server...
echo Access the dashboard at: http://127.0.0.1:8000
echo ===================================================
if not exist "backend\main.py" (
echo [ERROR] backend\main.py not found!
pause
exit /b 1
)
python backend\main.py
if errorlevel 1 (
echo.
echo [ERROR] Backend server stopped unexpectedly or failed to start.
pause
exit /b 1
)
pause