-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_eval_progress.py
More file actions
41 lines (35 loc) · 1.12 KB
/
Copy pathcheck_eval_progress.py
File metadata and controls
41 lines (35 loc) · 1.12 KB
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
"""检查评估进度"""
import sqlite3
conn = sqlite3.connect('data/traces.db')
# 查找最新的 run_id
cursor = conn.execute("""
SELECT run_id, started_at, case_count, completed_at
FROM eval_runs
ORDER BY started_at DESC
LIMIT 3
""")
print("Recent eval runs:")
for row in cursor:
print(f" run_id: {row[0][:8]}...")
print(f" started: {row[1]}")
print(f" cases: {row[2]}")
print(f" finished: {row[3]}")
# 检查这个 run 的进度
cursor2 = conn.execute("""
SELECT COUNT(*), AVG(CASE WHEN actual_output IS NOT NULL THEN 1.0 ELSE 0.0 END)
FROM eval_results
WHERE run_id=?
""", (row[0],))
count, has_output = cursor2.fetchone()
print(f" results: {count}/{row[2]}, {int(has_output*100)}% have output")
# 检查是否有 eval_samples
cursor3 = conn.execute("""
SELECT COUNT(DISTINCT trace_id)
FROM eval_samples
WHERE trace_id IN (
SELECT trace_id FROM eval_results WHERE run_id=?
)
""", (row[0],))
sample_count = cursor3.fetchone()[0]
print(f" eval_samples: {sample_count} traces\n")
conn.close()