improvements
This commit is contained in:
10
ai_eval.py
10
ai_eval.py
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user