Skip to content

Commit 7b31a98

Browse files
committed
chore: add local batch transcription and staging test scripts
1 parent e44731c commit 7b31a98

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

runme.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
IDS=(
4+
LPtdCCZcOOM
5+
df7X19vi3oo
6+
v4eK88964Q0
7+
J5SQ7bIirHo
8+
8CheVcGJgIo
9+
INF0vvE7MgE
10+
fAzT173IRRg
11+
uzKDi93xaa0
12+
kzdvMghUNgc
13+
ONsxyiKjRHA
14+
uxh5Oyq1SAI
15+
VKrnJ8ulrgI
16+
KTu-MFFamGQ
17+
8JahrKBqMtw
18+
iyeANTWj-w8
19+
aSjd9O94MY0
20+
AVT35BrPZIA
21+
xKChhsGpcf4
22+
WcZ4ZlS5YgI
23+
cTn1apqwjFk
24+
8ZyEWl2BpDU
25+
yYnhpwqZheY
26+
PU4vmxf9GwM
27+
3mWD_cAFUf4
28+
YoIx5icYLR0
29+
twui16wvTck
30+
Fr_GaEW-ORE
31+
z-Fx-ujvLYw
32+
_MndwltYWJg
33+
UBQGqpv_TN4
34+
BWGtHgE2ZOY
35+
jWIVADUCoYE
36+
t_AdkT9q6z0
37+
iQZXLJ5T5yM
38+
LTWQaAfcATE
39+
p5Kvc2vfmrg
40+
)
41+
for vid in "${IDS[@]}"; do
42+
echo "=== Transcribing ${vid} ==="
43+
python transcribe.py \
44+
--video="${vid}" \
45+
--segment-minutes 30 \
46+
--overlap-minutes 1 \
47+
--caption-context \
48+
--caption-context-buffer-seconds 30 \
49+
--caption-context-max-chars 1200 \
50+
--output-file "transcription_output_${vid}.json"
51+
done

test_staging.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env python3
2+
import json
3+
import urllib.request
4+
5+
6+
def req(method, url, data=None):
7+
b = json.dumps(data).encode() if data else None
8+
r = urllib.request.Request(
9+
url, data=b, headers={"Content-Type": "application/json"}, method=method
10+
)
11+
return json.loads(urllib.request.urlopen(r, timeout=90).read().decode())
12+
13+
14+
q = "What did ministers say about water management recently?"
15+
for port, name in [(8013, "green"), (8003, "blue")]:
16+
try:
17+
t = req("POST", f"http://127.0.0.1:{port}/chat/threads")
18+
res = req(
19+
"POST",
20+
f"http://127.0.0.1:{port}/chat/threads/{t['thread_id']}/messages",
21+
{"content": q},
22+
)
23+
dbg = (res.get("debug") or {}).get("retrieval") or {}
24+
print(f"[{name}]")
25+
print(f" edge_count={dbg.get('edge_count')}")
26+
print(f" node_count={dbg.get('node_count')}")
27+
print(f" seed_count={dbg.get('seed_count')}")
28+
print(f" threshold={dbg.get('edge_rank_threshold')}")
29+
print(f" filtered={dbg.get('edges_filtered_by_threshold')}")
30+
print(f" skipped={dbg.get('edge_rank_filter_skipped_no_scores')}")
31+
print(f" sources={len(res.get('sources') or [])}")
32+
print(
33+
f" snippet={(res.get('assistant_message', {}).get('content', '')[:150]).replace(chr(10), ' ')}"
34+
)
35+
except Exception as e:
36+
print(f"[{name}] ERROR: {e}")
37+
print()

0 commit comments

Comments
 (0)