From d9f1fcd6d7d918a9e42dc44218f247b9f2cb74c0 Mon Sep 17 00:00:00 2001 From: Galoist Date: Tue, 3 Sep 2024 00:08:29 +0300 Subject: [PATCH] Fix for nllb (#64) --- dl_translate/_translation_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dl_translate/_translation_model.py b/dl_translate/_translation_model.py index d81e2ed..9e3b3ac 100644 --- a/dl_translate/_translation_model.py +++ b/dl_translate/_translation_model.py @@ -170,7 +170,7 @@ def translate( batch_size = len(text) generation_options.setdefault( - "forced_bos_token_id", self._tokenizer.lang_code_to_id[target] + "forced_bos_token_id", self._tokenizer.convert_tokens_to_ids(target) ) generation_options.setdefault("max_new_tokens", 512)