Files
rpa_vision_v3/tools/start_grounding_server.sh
Dom 9da589c8c2 feat(grounding): pipeline centralisé + serveur UI-TARS transformers + nettoyage code mort
Architecture grounding complète :
- core/grounding/server.py : serveur FastAPI (port 8200) avec UI-TARS-1.5-7B en 4-bit NF4
  Process séparé avec son propre contexte CUDA (résout le crash Flask/CUDA)
- core/grounding/pipeline.py : orchestrateur cascade template→OCR→UI-TARS→static
- core/grounding/template_matcher.py : TemplateMatcher centralisé (remplace 5 copies)
- core/grounding/ui_tars_grounder.py : client HTTP vers le serveur de grounding
- core/grounding/target.py : GroundingTarget + GroundingResult

ORA modifié :
- _act_click() : capture unique de l'écran envoyée au serveur de grounding
- Pre-check VLM skippé pour ui_tars (redondant, et Ollama n'a plus de VRAM)
- verify_level='none' par défaut (vérification titre OCR prévue en Phase 2)
- Détection réponses négatives UI-TARS ("I don't see it" → fallback OCR)

Nettoyage :
- 9 fichiers morts archivés dans _archive/ (~6300 lignes supprimées)
- 21 tests ajoutés pour TemplateMatcher

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-25 17:48:18 +02:00

40 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Lancement du serveur de grounding UI-TARS (port 8200)
#
# Le serveur charge UI-TARS-1.5-7B en 4-bit NF4 dans son propre process
# Python avec un contexte CUDA propre. Le backend Flask VWB et la boucle
# ORA appellent ce serveur en HTTP.
#
# Usage :
# ./tools/start_grounding_server.sh # premier plan
# ./tools/start_grounding_server.sh --bg # arriere-plan (log dans /tmp)
set -e
cd /home/dom/ai/rpa_vision_v3
VENV=".venv/bin/python3"
LOG="/tmp/grounding_server.log"
if [ ! -f "$VENV" ]; then
echo "ERREUR: venv non trouve a $VENV"
exit 1
fi
echo "=== Serveur de Grounding UI-TARS ==="
echo "Port: 8200"
echo "Modele: ByteDance-Seed/UI-TARS-1.5-7B (4-bit NF4)"
echo ""
if [ "$1" = "--bg" ]; then
echo "Lancement en arriere-plan (logs dans $LOG)"
nohup $VENV -m core.grounding.server > "$LOG" 2>&1 &
PID=$!
echo "PID: $PID"
echo "$PID" > /tmp/grounding_server.pid
echo "Verifier: curl http://localhost:8200/health"
echo "Logs: tail -f $LOG"
else
$VENV -m core.grounding.server
fi