Commit c473d7e0 authored by janEbert's avatar janEbert
Browse files

Create output path directory if necessary

parent 3d14707a
...@@ -2,6 +2,7 @@ import argparse ...@@ -2,6 +2,7 @@ import argparse
import json import json
import logging import logging
import fnmatch import fnmatch
import os
from lm_eval import tasks, evaluator from lm_eval import tasks, evaluator
...@@ -94,6 +95,7 @@ def main(): ...@@ -94,6 +95,7 @@ def main():
print(dumped) print(dumped)
if args.output_path: if args.output_path:
os.makedirs(os.path.dirname(args.output_path), exist_ok=True)
with open(args.output_path, "w") as f: with open(args.output_path, "w") as f:
f.write(dumped) f.write(dumped)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment