Embarquer modèle NER + chargement auto au démarrage

- 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>
This commit is contained in:
2026-02-16 15:31:17 +01:00
parent 8339069c83
commit 2e7e31a1f9
3 changed files with 50 additions and 15 deletions

View File

@@ -9,7 +9,7 @@ on:
jobs:
build-windows:
runs-on: windows-latest
timeout-minutes: 45
timeout-minutes: 60
steps:
- name: Checkout
@@ -27,6 +27,10 @@ jobs:
pip install -r requirements.txt
pip install nuitka orderedset zstandard
- name: Download NER model
run: |
python -c "from ner_manager_onnx import NerModelManager; m=NerModelManager(cache_dir='models'); m.load('cmarkea/distilcamembert-base-ner'); print('Model OK:', m.is_loaded()); m.unload()"
- name: Build with Nuitka
run: |
python -m nuitka `
@@ -37,6 +41,7 @@ jobs:
--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=Pseudonymisation.exe `
--company-name="Hopital" `
@@ -47,22 +52,15 @@ jobs:
--remove-output `
Pseudonymisation_Gui_V5.py
- name: Prepare release archive
run: |
New-Item -ItemType Directory -Force -Path dist
Copy-Item Pseudonymisation.exe dist/
Copy-Item -Recurse config dist/config
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Pseudonymisation-Windows-x64
path: dist/
path: Pseudonymisation.exe
retention-days: 30
- name: Upload to release (on tag)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
dist/Pseudonymisation.exe
files: Pseudonymisation.exe