rabukasim / tools /_legacy_scripts /ai /analysis /extract_final.py
trioskosmos's picture
Upload folder using huggingface_hub
463f868 verified
import os
path = "evaluation_results.txt"
if os.path.exists(path):
with open(path, "rb") as f:
data = f.read()
content = ""
for enc in ["utf-16", "utf-8"]:
try:
content = data.decode(enc)
break
except:
continue
lines = [
l for l in content.splitlines() if any(k in l for k in ["Win Rate", "Avg Reward", "Avg Score", "Conclusion"])
]
with open("metrics_fixed.txt", "w", encoding="utf-8") as f:
f.write("\n".join(lines))
else:
print("File not found.")