Download tests/run_bench.py from Shaptoli/Sinccon: direct link, hf CLI and curl.
- Browser
- Download file 1.7 kB
-
https://huggingface.co/spaces/Shaptoli/Sinccon/resolve/main/tests/run_bench.py
- Command line
-
hf download hf://spaces/Shaptoli/Sinccon/tests/run_bench.py
-
curl -L -o run_bench.py https://huggingface.co/spaces/Shaptoli/Sinccon/resolve/main/tests/run_bench.py
1.7 kB
| import json, sys, pathlib | |
| if sys.platform == "win32": | |
| sys.stdout.reconfigure(encoding="utf-8") | |
| sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent.parent)) | |
| from app.pipeline import solve_problem | |
| from app.verify import same_answer | |
| def run_bench(): | |
| bench_file = pathlib.Path(__file__).parent / "bench.json" | |
| items = json.loads(bench_file.read_text(encoding="utf-8")) | |
| print("=" * 70) | |
| print("SINCC.ON: MATEMATIK VA MANTIQIY TESTLAR BAZASINI TEKSHIRISH") | |
| print(f"Jami testlar soni: {len(items)}") | |
| print("=" * 70) | |
| correct = 0 | |
| verified = 0 | |
| consensus_count = 0 | |
| for i, it in enumerate(items, 1): | |
| print(f"\n[{i}/{len(items)}] Masala: {it['q']}") | |
| print(f"Kategoriya: {it.get('category', 'Umumiy')} | Kutilgan javob: {it['a']}") | |
| r = solve_problem(it["q"]) | |
| ok = same_answer(str(r["final_answer"]), it["a"]) | |
| correct += ok | |
| verified += r.get("verified", False) | |
| consensus_count += r.get("consensus", False) | |
| status = "[TO'G'RI]" if ok else "[XATO]" | |
| print(f"Natija: {status} | Olingan javob: {r['final_answer']} | SymPy tasdiqladi: {r.get('verified')} | Konsensus: {r.get('consensus')}") | |
| if r.get("note"): | |
| print(f"Izoh: {r['note']}") | |
| n = len(items) | |
| print("\n" + "=" * 70) | |
| print(f"YAKUNIY STATISTIKA:") | |
| print(f"-> To'g'ri yechilgan: {correct}/{n} ({correct/n*100:.1f}%)") | |
| print(f"-> SymPy tasdiqlagan: {verified}/{n} ({verified/n*100:.1f}%)") | |
| print(f"-> Konsensusga kelingan: {consensus_count}/{n} ({consensus_count/n*100:.1f}%)") | |
| print("=" * 70) | |
| if __name__ == "__main__": | |
| run_bench() | |