BLEU calculation occurs only on the CPU, perhaps this is somehow related to the function below
eval.py#L56C44-L56C44
def translator():
device = "cuda" if ctranslate2.get_cuda_device_count() > 0 else "cpu"
model = ctranslate2.Translator(ct2_model_dir, device="cpu", compute_type="default")
if os.path.isfile(sp_model):
tokenizer = SentencePieceTokenizer(sp_model)
elif os.path.isfile(bpe_model):
tokenizer = BPETokenizer(bpe_model, config["from"]["code"], config["to"]["code"])
return {"model": model, "tokenizer": tokenizer}
I tried replacing device="cpu" with device=device , in which case the GPU was used, but I was getting an OOM error.
BLEU calculation occurs only on the CPU, perhaps this is somehow related to the function below
eval.py#L56C44-L56C44
I tried replacing
device="cpu"withdevice=device, in which case the GPU was used, but I was getting an OOM error.