Organize Open-SWE-Traces data prep project
This commit is contained in:
32
scripts/probing/inspect_sample.py
Normal file
32
scripts/probing/inspect_sample.py
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import pyarrow.parquet as pq
|
||||
|
||||
|
||||
BASE = Path("data/Open-SWE-Traces/data")
|
||||
CONFIGS = [
|
||||
"minimax_m25_openhands_trajectories",
|
||||
"minimax_m25_sweagent_trajectories",
|
||||
"qwen35_openhands_trajectories",
|
||||
"qwen35_sweagent_trajectories",
|
||||
]
|
||||
|
||||
|
||||
def main() -> int:
|
||||
for cfg in CONFIGS:
|
||||
file = sorted((BASE / cfg).glob("*.parquet"))[0]
|
||||
row = pq.read_table(file).slice(0, 1).to_pylist()[0]
|
||||
print("CFG", cfg)
|
||||
print("cols", list(row.keys()))
|
||||
trajectory = row["trajectory"]
|
||||
print("len", len(trajectory))
|
||||
for index, message in enumerate(trajectory[:10]):
|
||||
print("MSG", index, json.dumps(message, ensure_ascii=False)[:1600])
|
||||
print("---")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user