Files

14 lines
829 B
Bash

#!/bin/bash
CID=115991
for M in smallest-tts smallest-tts-pro; do
for G in default premium t1 t2 t3 t4; do
sudo -u postgres psql -d newapi -q -c "insert into abilities (\"group\",model,channel_id,enabled,priority,weight,tag) values ('$G','$M',$CID,true,700,1,'sm');" >/dev/null 2>&1
done
done
echo "abilities=$(sudo -u postgres psql -d newapi -tAc "select count(*) from abilities where channel_id=$CID;" 2>/dev/null | tr -d ' ')"
KEY=$(cat /root/_sm_key)
systemctl restart new-api; sleep 10
curl -s -m 120 -o /tmp/gw.wav -w "gateway:%{http_code} size:%{size_download}\n" -X POST http://127.0.0.1:48000/v1/audio/speech -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" -d '{"model":"smallest-tts","input":"gateway routing check one two three","voice":"lakshya"}'
file /tmp/gw.wav
head -c 120 /tmp/gw.wav