Added to main--now things dont break with test dummy for probing
@@ -22,6 +22,7 @@ from src.preprocess import build_tasks
from src.models import build_model
from src.trainer import build_trainer, build_trainer_params
from src.evaluate import evaluate, write_results, write_preds
+from src.tasks import NLITypeProbingTask
def handle_arguments(cl_arguments):
@@ -236,6 +237,9 @@ def main(cl_arguments):
log.info("Evaluating...")
val_results, _ = evaluate(model, tasks, args.batch_size, args.cuda, "val")
if args.write_preds:
+ if isinstance(tasks[0], NLITypeProbingTask):
+ _, te_preds = evaluate(model, tasks, args.batch_size, args.cuda, "val")
+ else:
_, te_preds = evaluate(model, tasks, args.batch_size, args.cuda, "test")
write_preds(te_preds, args.run_dir)
