Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit cf59cc1

Browse files
committed
Add --no-gpu flag
1 parent 2549fc7 commit cf59cc1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/eval_saved.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ def main():
3737
help='a NumPy binary file containing the corresponding embeddings')
3838
parser.add_argument('-t', '--tasks',
3939
help='a comma-separated list of tasks')
40+
parser.add_argument('--no-gpu', action='store_true',
41+
help='do not use GPU (turn off PyTorch)')
4042
args = parser.parse_args()
4143

4244
sent2emb = {}
@@ -70,7 +72,7 @@ def batcher(params, batch):
7072
return embeddings
7173

7274
params_senteval = {
73-
'task_path': PATH_TO_DATA, 'usepytorch': True, 'kfold': 10
75+
'task_path': PATH_TO_DATA, 'usepytorch': not args.no_gpu, 'kfold': 10
7476
}
7577
params_senteval['classifier'] = {
7678
'nhid': 0, 'optim': 'adam', 'batch_size': 64, 'tenacity': 5,

0 commit comments

Comments
 (0)