Skip to content

Commit eec20d7

Browse files
committed
Create output_dir when using from_config
1 parent 65fd3ef commit eec20d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/structured_qa/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def structured_qa(
4848
If provided, all other arguments will be ignored.
4949
"""
5050
if from_config:
51-
config = Config.model_validate(yaml.safe_load(Path(from_config).read_text()))
51+
raw_config = yaml.safe_load(Path(from_config).read_text())
52+
Path(raw_config["output_dir"]).mkdir(exist_ok=True, parents=True)
53+
config = Config.model_validate(raw_config)
5254
else:
5355
Path(output_dir).mkdir(exist_ok=True, parents=True)
5456
config = Config(input_file=input_file, output_dir=output_dir)

0 commit comments

Comments
 (0)