Vollständige Pipeline zur Analyse kommunaler Vorlagen aus ALLRIS: - OParl-Import: 20.149 Vorlagen - PDF-Extraktion: 10.045 Volltexte (adaptives Throttling) - KI-Zusammenfassungen: 10.026 via Qwen Plus (parallelisiert) - Beratungsfolge-Scraper: Beschlusstexte + Wortprotokolle - Abstimmungs-Analyse mit Koalitionsmatrix - Georeferenzierung (Nominatim) Stack: FastAPI + SvelteKit + SQLite Deployment: Docker + Traefik auf VServer Daten (DB, Logs) nicht im Repo — siehe Restic-Backup. Repo-Setup: scripts/setup.sh für Neuaufbau aus OParl-API.
33 lines
907 B
Bash
Executable File
33 lines
907 B
Bash
Executable File
#!/bin/bash
|
|
# Parallele KI-Zusammenfassungen in Batches bis alles fertig
|
|
|
|
cd "$(dirname "$0")/.."
|
|
source .venv/bin/activate
|
|
|
|
LOG_FILE="data/ki_parallel_batches.log"
|
|
WORKERS=15
|
|
BATCH_SIZE=100
|
|
PAUSE_SECONDS=5
|
|
|
|
echo "=== KI-Parallel-Runner gestartet $(date) ===" | tee -a "$LOG_FILE"
|
|
echo "Workers: $WORKERS, Batch: $BATCH_SIZE" | tee -a "$LOG_FILE"
|
|
|
|
while true; do
|
|
echo "" | tee -a "$LOG_FILE"
|
|
echo "--- Starte Batch $(date +%H:%M:%S) ---" | tee -a "$LOG_FILE"
|
|
|
|
python scripts/ki_parallel.py --workers $WORKERS --batch-size $BATCH_SIZE 2>&1 | tee -a "$LOG_FILE"
|
|
EXIT_CODE=${PIPESTATUS[0]}
|
|
|
|
if [ $EXIT_CODE -eq 0 ]; then
|
|
echo "" | tee -a "$LOG_FILE"
|
|
echo "=== ALLE FERTIG $(date) ===" | tee -a "$LOG_FILE"
|
|
break
|
|
fi
|
|
|
|
echo "Pause ${PAUSE_SECONDS}s..." | tee -a "$LOG_FILE"
|
|
sleep $PAUSE_SECONDS
|
|
done
|
|
|
|
echo "Runner beendet." | tee -a "$LOG_FILE"
|