diff --git a/machine/translation/huggingface/hugging_face_nmt_model_trainer.py b/machine/translation/huggingface/hugging_face_nmt_model_trainer.py index 743696b..ddc8dfc 100644 --- a/machine/translation/huggingface/hugging_face_nmt_model_trainer.py +++ b/machine/translation/huggingface/hugging_face_nmt_model_trainer.py @@ -201,7 +201,8 @@ def add_tokens(tokenizer: Any, missing_tokens: List[str]) -> Any: ) else: norm_tok = PreTrainedTokenizerFast.from_pretrained( - "./machine/translation/huggingface/custom_normalizer", use_fast=True + str(Path(os.path.dirname(os.path.abspath(__file__))) / "custom_normalizer"), + use_fast=True, ) # using unofficially supported behavior to set the normalizer tokenizer.backend_tokenizer.normalizer = norm_tok.backend_tokenizer.normalizer # type: ignore