"vscode:/vscode.git/clone" did not exist on "b3e8d57d51300b88b591900621f71b6a1b3a7acc"
Commit 6c816cb7 authored by Leo Gao's avatar Leo Gao
Browse files

write_out: fallover to training data if no validation

parent 31b2a5dd
...@@ -32,8 +32,9 @@ def main(): ...@@ -32,8 +32,9 @@ def main():
os.makedirs(args.output_base_path, exist_ok=True) os.makedirs(args.output_base_path, exist_ok=True)
for task_name, task in task_dict.items(): for task_name, task in task_dict.items():
if not task.has_validation_docs(): if not task.has_validation_docs():
continue docs = task.training_docs()
docs = task.validation_docs() else:
docs = task.validation_docs()
with open(os.path.join(args.output_base_path, task_name), "w") as f: with open(os.path.join(args.output_base_path, task_name), "w") as f:
for i, doc in zip(range(args.num_examples), docs): for i, doc in zip(range(args.num_examples), docs):
f.write(EXAMPLE_DIVIDER.format(i=i)) f.write(EXAMPLE_DIVIDER.format(i=i))
......
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