From 670168abdd6fe4c0abad19ea9606ae9be5c62105 Mon Sep 17 00:00:00 2001 From: Ondrej Cifka Date: Sun, 12 Aug 2018 14:08:43 +0200 Subject: [PATCH] Add --no-gpu flag --- examples/eval_saved.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/eval_saved.py b/examples/eval_saved.py index 195e817c..e1dbc190 100755 --- a/examples/eval_saved.py +++ b/examples/eval_saved.py @@ -37,6 +37,8 @@ def main(): help='a NumPy binary file containing the corresponding embeddings') parser.add_argument('-t', '--tasks', help='a comma-separated list of tasks') + parser.add_argument('--no-gpu', action='store_true', + help='do not use GPU (turn off PyTorch)') args = parser.parse_args() sent2emb = {} @@ -70,7 +72,7 @@ def batcher(params, batch): return embeddings params_senteval = { - 'task_path': PATH_TO_DATA, 'usepytorch': True, 'kfold': 10 + 'task_path': PATH_TO_DATA, 'usepytorch': not args.no_gpu, 'kfold': 10 } params_senteval['classifier'] = { 'nhid': 0, 'optim': 'adam', 'batch_size': 64, 'tenacity': 5,