Commit 7d8f5469 authored by lintangsutawika's avatar lintangsutawika
Browse files

fix on output_path_file

parent b7cd829b
...@@ -24,7 +24,7 @@ def parse_args(): ...@@ -24,7 +24,7 @@ def parse_args():
help="String arguments for model, e.g. `pretrained=EleutherAI/pythia-160m,dtype=float32`", help="String arguments for model, e.g. `pretrained=EleutherAI/pythia-160m,dtype=float32`",
) )
parser.add_argument( parser.add_argument(
"--tasks", default=None, choices=utils.MultiChoice(sorted(ALL_TASKS)) "--tasks", default=None # , choices=utils.MultiChoice(sorted(ALL_TASKS))
) )
parser.add_argument( parser.add_argument(
"--num_fewshot", "--num_fewshot",
...@@ -137,6 +137,7 @@ def main(): ...@@ -137,6 +137,7 @@ def main():
eval_logger.warning( eval_logger.warning(
f"File already exists at {path}. Results will be overwritten." f"File already exists at {path}. Results will be overwritten."
) )
output_path_file = path.joinpath("results.json")
assert not path.is_file(), "File already exists" assert not path.is_file(), "File already exists"
# if path json then get parent dir # if path json then get parent dir
elif path.suffix in (".json", ".jsonl"): elif path.suffix in (".json", ".jsonl"):
...@@ -182,7 +183,7 @@ def main(): ...@@ -182,7 +183,7 @@ def main():
if args.log_samples: if args.log_samples:
for task_name, config in results["configs"].items(): for task_name, config in results["configs"].items():
output_name = "{}_{}".format( output_name = "{}_{}".format(
re.sub("/", "__", args.model_args), task_name re.sub("/|=", "__", args.model_args), task_name
) )
filename = path.joinpath(f"{output_name}.jsonl") filename = path.joinpath(f"{output_name}.jsonl")
......
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