#!/bin/bash
cd /data/local/tmp/kz-engine
R="--reasoning-budget 0 -st --temp 0"
TH="GGML_HEXAGON_GDN_PREFILL=1 LD_LIBRARY_PATH=./lib ADSP_LIBRARY_PATH=./lib ./llama-cli -ngl 99 -dev HTP0 $R"
SP="LD_LIBRARY_PATH=./lib ./llama-cli -dev none -t 8 $R"
for i in 1 2 3; do P=$(sed -n "${i}p" prompts.txt)
 eval $TH -m Qwen3Guard-Gen-4B.Q4_K_M.gguf -p "\"Psy. 4 lignes emotion besoin approche axe: $P\"" -n 45 2>/dev/null|tr -d '\r'>b$i.txt
 B=$(grep -aiE 'emot|besoin|approch|axe' b$i.txt|tr '\n' ' '|cut -c1-160)
 eval $SP -m Qwen3.5-4B-Q4_0.gguf -p "\"Kazeia psy, 1-2 phrases FR. Indices:$B. Patient: $P\"" -n 35 2>/dev/null|tr -d '\r'>s4_$i.txt
 eval $SP -m Qwen3.5-9B-Q4_0.gguf -p "\"Kazeia psy, 1-2 phrases FR. Indices:$B. Patient: $P\"" -n 35 2>/dev/null|tr -d '\r'>s9_$i.txt
done; echo FIN
