From 59c9e40814808a99b0235841a36904f633301ae6 Mon Sep 17 00:00:00 2001 From: Javier <25750030+SystemPanic@users.noreply.github.com> Date: Thu, 8 Feb 2024 01:23:15 -0600 Subject: [PATCH] Fix utf-8 yaml load for marian conversion to pytorch in Windows (#28618) Fix utf-8 yaml in marian conversion --- src/transformers/models/marian/convert_marian_to_pytorch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformers/models/marian/convert_marian_to_pytorch.py b/src/transformers/models/marian/convert_marian_to_pytorch.py index 0eb17063c2ba77..79afd50955ddd1 100644 --- a/src/transformers/models/marian/convert_marian_to_pytorch.py +++ b/src/transformers/models/marian/convert_marian_to_pytorch.py @@ -677,7 +677,7 @@ def convert(source_dir: Path, dest_dir): def load_yaml(path): import yaml - with open(path) as f: + with open(path, encoding="utf-8") as f: return yaml.load(f, Loader=yaml.BaseLoader)