Compare commits

...
3 Commits
Author SHA1 Message Date
LysandreJik e411222a47 Sacremoses in TransfoXL 2020-11-16 16:34:58 -05:00
LysandreJik 791b6928eb Sacremoses in FSMT 2020-11-16 16:33:31 -05:00
LysandreJik 7211ba1231 Sacremoses 2020-11-16 16:30:51 -05:00
3 changed files with 16 additions and 5 deletions
+5 -2
View File
@@ -21,8 +21,6 @@ import re
import unicodedata
from typing import Dict, List, Optional, Tuple
import sacremoses as sm
from .file_utils import add_start_docstrings
from .tokenization_utils import BatchEncoding, PreTrainedTokenizer
from .tokenization_utils_base import PREPARE_SEQ2SEQ_BATCH_DOCSTRING
@@ -31,6 +29,11 @@ from .utils import logging
logger = logging.get_logger(__name__)
try:
import sacremoses as sm
except ModuleNotFoundError:
logger.error("Sacremoses not found. Will not be able to instantiate an XLM tokenizer.")
VOCAB_FILES_NAMES = {
"src_vocab_file": "vocab-src.json",
"tgt_vocab_file": "vocab-tgt.json",
+6 -2
View File
@@ -27,8 +27,6 @@ from typing import List, Optional, Tuple
import numpy as np
import sacremoses as sm
from .file_utils import cached_path, is_torch_available, torch_only_method
from .tokenization_utils import PreTrainedTokenizer
from .utils import logging
@@ -40,6 +38,12 @@ if is_torch_available():
logger = logging.get_logger(__name__)
try:
import sacremoses as sm
except ModuleNotFoundError:
logger.error("Sacremoses not found. Will not be able to instantiate an XLM tokenizer.")
VOCAB_FILES_NAMES = {
"pretrained_vocab_file": "vocab.pkl",
"pretrained_vocab_file_torch": "vocab.bin",
+5 -1
View File
@@ -22,7 +22,6 @@ import sys
import unicodedata
from typing import List, Optional, Tuple
import sacremoses as sm
from .tokenization_utils import PreTrainedTokenizer
from .utils import logging
@@ -30,6 +29,11 @@ from .utils import logging
logger = logging.get_logger(__name__)
try:
import sacremoses as sm
except ModuleNotFoundError:
logger.error("Sacremoses not found. Will not be able to instantiate an XLM tokenizer.")
VOCAB_FILES_NAMES = {
"vocab_file": "vocab.json",
"merges_file": "merges.txt",