Sécurité VLM : format JSON forcé, modèle local uniquement, fix logging critique
- vlm_manager: ajout format:json dans payload Ollama (élimine hallucinations JSON) - vlm_manager: retour modèle local qwen2.5vl:7b (sécurité données médicales) - anonymizer_core: ajout import logging (fix NameError silencieux qui tuait le VLM) - anonymizer_core: masquage direct pages manuscrites (suppression rotation inutile) - GUI: intégration checkbox VLM + auto-load EDS-Pseudo prioritaire Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,7 @@ log = logging.getLogger(__name__)
|
||||
class VlmConfig:
|
||||
"""Configuration pour le VLM Ollama."""
|
||||
base_url: str = "http://localhost:11434"
|
||||
model: str = "qwen3-vl:235b-instruct-cloud"
|
||||
model: str = "qwen2.5vl:7b"
|
||||
timeout: int = 180
|
||||
max_image_size: int = 2048 # pixels (côté le plus long)
|
||||
temperature: float = 0.1
|
||||
@@ -211,7 +211,7 @@ class VlmManager:
|
||||
+ ", ".join(existing_pii[:20])
|
||||
)
|
||||
|
||||
# Appel API Ollama
|
||||
# Appel API Ollama — format: json force une sortie JSON valide
|
||||
payload = {
|
||||
"model": cfg.model,
|
||||
"messages": [
|
||||
@@ -222,6 +222,7 @@ class VlmManager:
|
||||
"images": [img_b64],
|
||||
},
|
||||
],
|
||||
"format": "json",
|
||||
"stream": False,
|
||||
"options": {
|
||||
"temperature": cfg.temperature,
|
||||
|
||||
Reference in New Issue
Block a user