THUNLP-MT / THUMT

An open-source neural machine translation toolkit developed by Tsinghua Natural Language Processing Group
BSD 3-Clause "New" or "Revised" License
701 stars 197 forks source link

Code Problem and Potential Solution: Inference with CPU #117

Open Beau-xu opened 2 years ago

Beau-xu commented 2 years ago

It seems that the parameter enabling CPU inference is not correctly passed to the function get_infer_dataset. Actually, the function get_eval_dataset has the same issue.

image

Those who have this problem can edit the code in /bin/translator.py and append the parameter cpu=args.cpu

data.MTPipeline.get_infer_dataset(args.input[0], params, cpu=args.cpu)