Safer usage of mkdir across the project

This commit is contained in:
oobabooga 2025-06-17 07:09:33 -07:00
parent 8689d7ecea
commit 0d1597616f
16 changed files with 240 additions and 206 deletions

View file

@ -27,7 +27,9 @@ def save_past_evaluations(df):
global past_evaluations
past_evaluations = df
filepath = Path('user_data/logs/evaluations.csv')
filepath.parent.mkdir(parents=True, exist_ok=True)
if not filepath.parent.exists():
filepath.parent.mkdir(parents=True, exist_ok=True)
df.to_csv(filepath, index=False)