Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions tool_calls_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ async def validate_file(self, file_path: str):
for task in asyncio.as_completed(tasks):
try:
res = await task
with megfile.smart_open(self.output_file, "a", encoding="utf-8") as f:
f.write(json.dumps(res, ensure_ascii=False) + "\n")
self.results.append(res)
except Exception as e:
logger.error(f"Task failed: {e}")
Expand All @@ -282,11 +284,6 @@ async def validate_file(self, file_path: str):

self.results.sort(key=lambda r: r["data_index"])

# Save results
with megfile.smart_open(self.output_file, "w", encoding="utf-8") as f:
for r in self.results:
f.write(json.dumps(r, ensure_ascii=False) + "\n")

# Compute summary
self.compute_summary()
with megfile.smart_open(self.summary_file, "w", encoding="utf-8") as f:
Expand Down