Repository navigation
Expand file tree
/
Copy pathbuild_exe.bat
More file actions
69 lines (61 loc) · 1.79 KB
/
Copy pathbuild_exe.bat
File metadata and controls
69 lines (61 loc) · 1.79 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
@echo off
setlocal EnableDelayedExpansion
echo ==========================================
echo AFOMIS Build Script
echo ==========================================
echo.
REM Check 1: bundled_models\bge-small-en-v1.5\
if not exist "bundled_models\bge-small-en-v1.5\" (
echo ERROR: bundled_models\bge-small-en-v1.5\ not found.
echo Please run: python scripts\bundle_embedding_model.py
exit /b 1
)
echo [OK] bundled_models\bge-small-en-v1.5\ found
REM Check 2: seed_data\chunks.json
if not exist "seed_data\chunks.json" (
echo ERROR: seed_data\chunks.json not found.
echo Please ensure the seed data file is present.
exit /b 1
)
echo [OK] seed_data\chunks.json found
REM Check 3: models\*.gguf
set GGUF_FOUND=0
for %%f in ("models\*.gguf") do (
set GGUF_FOUND=1
goto :gguf_check_done
)
:gguf_check_done
if %GGUF_FOUND%==0 (
echo ERROR: No .gguf files found in models\ directory.
echo Please place at least one GGUF model file in the models\ folder.
exit /b 1
)
echo [OK] At least one .gguf file found in models\
echo.
REM Activate venv if exists
if exist ".venv\Scripts\activate.bat" (
echo Activating virtual environment...
call .venv\Scripts\activate.bat
echo [OK] Virtual environment activated
echo.
) else (
echo [WARN] Virtual environment not found at .venv\Scripts\activate.bat
echo Continuing with system Python...
echo.
)
REM Run pyinstaller
echo Building AFOMIS...
pyinstaller AFOMIS.spec --clean --noconfirm
if errorlevel 1 (
echo.
echo ==========================================
echo Build failed!
echo ==========================================
exit /b 1
)
echo.
echo ==========================================
echo Build complete: dist\AFOMIS\AFOMIS.exe
echo ==========================================
endlocal
exit /b 0