improvements

This commit is contained in:
overcuriousity
2026-01-18 15:14:25 +01:00
parent 9853faf09b
commit 7697bb51ab
4 changed files with 1481 additions and 945 deletions

View File

@@ -929,15 +929,21 @@ Do not include any text before or after the JSON object."""
def save_results(self):
"""Save results to JSON file"""
# Ensure output directory exists
self.output_dir.mkdir(parents=True, exist_ok=True)
# Sanitize model name for use in filename (replace problematic characters)
safe_model_name = self.model_name.replace('/', '_').replace(':', '_')
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
filename = f"{self.model_name.replace(':', '_')}_{timestamp}.json"
filename = f"{safe_model_name}_{timestamp}.json"
filepath = self.output_dir / filename
with open(filepath, 'w', encoding='utf-8') as f:
json.dump(self.results, f, indent=2, ensure_ascii=False)
# Also save as "latest" for this model
latest_file = self.output_dir / f"{self.model_name.replace(':', '_')}_latest.json"
latest_file = self.output_dir / f"{safe_model_name}_latest.json"
with open(latest_file, 'w', encoding='utf-8') as f:
json.dump(self.results, f, indent=2, ensure_ascii=False)