#!/bin/bash
cd /data/local/tmp/kz-engine
TH="GGML_HEXAGON_GDN_PREFILL=1 LD_LIBRARY_PATH=./lib ADSP_LIBRARY_PATH=./lib ./llama-cli -ngl 99 -dev HTP0 --reasoning-budget 0 -st --temp 0"
SP="LD_LIBRARY_PATH=./lib ./llama-cli -dev none -t 8 --reasoning-budget 0 -st --temp 0"
ST="Psychologue clinicien. 4 lignes: emotion, besoin, approche, axe (5 mots max)."
SS="Tu es Kazeia, psy bienveillant. UNE ou DEUX phrases FR, 5-8 mots, validation simple."
for i in 1 2 3; do P=$(sed -n "${i}p" prompts.txt)
 eval $TH -m Qwen3Guard-Gen-4B.Q4_K_M.gguf -sys "\"$ST\"" -p "\"$P\"" -n 50 2>/dev/null|tr -d '\r'>b$i.txt
 B=$(grep -aiE 'emot|besoin|approch|axe' b$i.txt|tr '\n' ' ')
 eval $SP -m Qwen3.5-4B-Q4_0.gguf -sys "\"$SS Indices: $B\"" -p "\"$P\"" -n 40 2>/dev/null|tr -d '\r'>s4_$i.txt
 eval $SP -m Qwen3.5-9B-Q4_0.gguf -sys "\"$SS Indices: $B\"" -p "\"$P\"" -n 40 2>/dev/null|tr -d '\r'>s9_$i.txt
done; echo FIN
