Skip to content

Commit

Permalink
Add --no-gpu flag
Browse files Browse the repository at this point in the history
  • Loading branch information
cifkao committed Aug 12, 2018
1 parent e59bc5c commit 670168a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/eval_saved.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 670168a

Please sign in to comment.