Download tools/show_bba.py from RightNowAI/duplex-v0: direct link, hf CLI and curl.
- Browser
- Download file 697 Bytes
-
https://huggingface.co/RightNowAI/duplex-v0/resolve/main/tools/show_bba.py
- Command line
-
hf download hf://RightNowAI/duplex-v0/tools/show_bba.py
-
curl -L -o show_bba.py https://huggingface.co/RightNowAI/duplex-v0/resolve/main/tools/show_bba.py
697 Bytes
| """One line per question of a benchmark run folder: what was asked for, what was said, timings. | |
| python -m tools.show_bba eval/results/bba/manual | |
| """ | |
| import json | |
| import sys | |
| from pathlib import Path | |
| for f in sorted(Path(sys.argv[1]).glob("q_*.json")): | |
| q = json.loads(f.read_text()) | |
| done = [e for e in q.get("events", []) if e["type"] == "reply.done"] | |
| d = done[-1] if done else {} | |
| spoken = q["text"].split("</think>")[-1].strip() | |
| print(f"{q['category'][:10]:10s} official {q['official_answer']:8s} answer {str(q['answer']):8s} spoken {spoken[:60]!r} " | |
| f"thought_ms {d.get('thought_ms')} ttfa_ms {d.get('ttfa_ms')} audio_ms {d.get('audio_ms')} err {q.get('error')}") | |