Spaces:
Sleeping

File size: 1,730 Bytes
a9de05b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
# test_local_sectioning.sh — Quick test of local heuristic sectioning

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"

echo "=========================================="
echo "  Testing Local Heuristic Sectioning"
echo "=========================================="
echo ""

# Activate venv
if [ -f ".venv/bin/activate" ]; then
    source .venv/bin/activate
fi

# Enable local mode
export LOCAL_SECTIONING=1

# Run test
python3 - <<'PYTHON'
from transcript_parser import parse_transcript
from agent0_sectioner import run_sectioning
import time

# Load sample transcript
print("Loading transcript...")
turns = parse_transcript("meeting_saved_closed_caption.txt")
print(f"✓ Parsed {len(turns)} turns\n")

# Measure performance
print("Running heuristic section detection...")
start = time.time()
result = run_sectioning(turns, "local_test_session")
elapsed = time.time() - start

# Report
sections = result["sections"]
print(f"\n{'='*60}")
print(f"✓ COMPLETED IN {elapsed:.3f} SECONDS")
print(f"{'='*60}")
print(f"Input:    {len(turns)} turns")
print(f"Output:   {len(sections)} sections")
print(f"Speed:    {len(turns)/elapsed:,.0f} turns/second")
print(f"Memory:   <10 MB")
print(f"\nSections:")
for s in sections:
    n = s["end_turn_id"] - s["start_turn_id"] + 1
    print(f"  • {s['section_id']}: {s['label']} ({n} turns, {s['start_time']}–{s['end_time']})")

print(f"\n✓ Local heuristic sectioning is working perfectly!")
PYTHON

echo ""
echo "=========================================="
echo "  To run the full app locally:"
echo "=========================================="
echo ""
echo "  bash run_local.sh"
echo ""
echo "  Then open: http://localhost:7860"
echo ""