- GUI V5 : charge DistilCamemBERT-NER automatiquement en arrière-plan - _app_dir() : chemin compatible Nuitka onefile - Build Nuitka : inclut models/ + config/ dans le .exe - GitHub Actions : étape download model avant compilation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
55 lines
1.9 KiB
Batchfile
55 lines
1.9 KiB
Batchfile
@echo off
|
|
REM ============================================================
|
|
REM build_windows.bat — Compile Pseudonymisation GUI v5
|
|
REM avec Nuitka (Python -> C -> .exe natif Windows)
|
|
REM ============================================================
|
|
REM Prerequis :
|
|
REM - Python 3.10+ installe et dans le PATH
|
|
REM - pip install nuitka orderedset zstandard
|
|
REM - pip install -r requirements.txt
|
|
REM - Visual Studio Build Tools (ou MinGW64)
|
|
REM ============================================================
|
|
|
|
setlocal
|
|
set APP_NAME=Pseudonymisation
|
|
set ENTRY=Pseudonymisation_Gui_V5.py
|
|
set MODEL_ID=cmarkea/distilcamembert-base-ner
|
|
|
|
echo [build] Verification de Python...
|
|
python --version || (echo Python introuvable & exit /b 1)
|
|
|
|
echo [build] Installation de Nuitka si absent...
|
|
pip install nuitka orderedset zstandard 2>nul
|
|
|
|
echo [build] Telechargement du modele NER si absent...
|
|
python -c "from ner_manager_onnx import NerModelManager; m=NerModelManager(cache_dir='models'); m.load('%MODEL_ID%'); print('Modele OK'); m.unload()"
|
|
|
|
echo [build] Compilation avec Nuitka (cela peut prendre 10-20 min)...
|
|
python -m nuitka ^
|
|
--standalone ^
|
|
--onefile ^
|
|
--enable-plugin=tk-inter ^
|
|
--include-module=anonymizer_core_refactored_onnx ^
|
|
--include-module=ner_manager_onnx ^
|
|
--include-module=eds_pseudo_manager ^
|
|
--include-data-dir=config=config ^
|
|
--include-data-dir=models=models ^
|
|
--windows-console-mode=disable ^
|
|
--output-filename=%APP_NAME%.exe ^
|
|
--company-name="Hopital" ^
|
|
--product-name="Pseudonymisation de PDF" ^
|
|
--product-version=5.0.0 ^
|
|
--file-description="Pseudonymisation automatique de documents PDF" ^
|
|
--assume-yes-for-downloads ^
|
|
--remove-output ^
|
|
%ENTRY%
|
|
|
|
if %ERRORLEVEL% NEQ 0 (
|
|
echo [build] ERREUR : la compilation a echoue.
|
|
exit /b 1
|
|
)
|
|
|
|
echo [build] OK — Executable cree : %APP_NAME%.exe
|
|
echo [build] Le modele NER est embarque. Aucun telechargement necessaire.
|
|
endlocal
|