add pl_glue example test (#6034)

* add pl_glue example test

* for now just test that it runs, next validate results of eval or predict?

* complete the run_pl_glue test to validate the actual outcome

* worked on my machine, CI gets less accuracy - trying higher epochs

* match run_pl.sh hparms

* more epochs?

* trying higher lr

* for now just test that the script runs to a completion

* correct the comment

* if cuda is available, add --fp16 --gpus=1 to cover more bases

* style
This commit is contained in:
Stas Bekman
2020-08-11 00:16:52 -07:00
committed by GitHub
parent b25cec13c5
commit f6c0680d36
2 changed files with 44 additions and 2 deletions

View File

@@ -176,7 +176,7 @@ class GLUETransformer(BaseTransformer):
return parser
if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser()
add_generic_args(parser, os.getcwd())
parser = GLUETransformer.add_model_specific_args(parser, os.getcwd())
@@ -194,4 +194,8 @@ if __name__ == "__main__":
if args.do_predict:
checkpoints = list(sorted(glob.glob(os.path.join(args.output_dir, "checkpointepoch=*.ckpt"), recursive=True)))
model = model.load_from_checkpoint(checkpoints[-1])
trainer.test(model)
return trainer.test(model)
if __name__ == "__main__":
main()