Skip to content

Commit

Permalink
update translate.py gpu option
Browse files Browse the repository at this point in the history
  • Loading branch information
bmccann authored and soumith committed Feb 23, 2017
1 parent a742fe2 commit b840cad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OpenNMT/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def reportScore(name, scoreTotal, wordsTotal):

def main():
opt = parser.parse_args()
opt.cuda = True if opt.gpu > -1
opt.cuda = opt.gpu > -1
torch.cuda.set_device(opt.gpu)

translator = onmt.Translator(opt)
Expand Down

0 comments on commit b840cad

Please sign in to comment.