mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-09-26 00:24:14 +00:00
Create target folder if not exists in EvalResult.save() (#2647)
* Create target folder if not exists in EvalResult.save() * log out dir
This commit is contained in:
parent
9968c373d2
commit
c8f9e1b76c
@ -1245,6 +1245,9 @@ class EvaluationResult:
|
|||||||
:param out_dir: Path to the target folder the csvs will be saved.
|
:param out_dir: Path to the target folder the csvs will be saved.
|
||||||
"""
|
"""
|
||||||
out_dir = out_dir if isinstance(out_dir, Path) else Path(out_dir)
|
out_dir = out_dir if isinstance(out_dir, Path) else Path(out_dir)
|
||||||
|
logger.info(f"Saving evaluation results to {out_dir}")
|
||||||
|
if not out_dir.exists():
|
||||||
|
out_dir.mkdir(parents=True)
|
||||||
for node_name, df in self.node_results.items():
|
for node_name, df in self.node_results.items():
|
||||||
target_path = out_dir / f"{node_name}.csv"
|
target_path = out_dir / f"{node_name}.csv"
|
||||||
df.to_csv(target_path, index=False, header=True)
|
df.to_csv(target_path, index=False, header=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user