convert: Fix type hint for special_token_types in SpecialVocab

This commit is contained in:
KerfuffleV2 2023-08-27 19:36:07 -06:00
parent 531746e953
commit 120ed6453f

View file

@ -423,7 +423,7 @@ class SpecialVocab:
special_token_types: Tuple[str, ...] = tuple(('bos', 'eos', 'unk', 'sep', 'pad')) special_token_types: Tuple[str, ...] = tuple(('bos', 'eos', 'unk', 'sep', 'pad'))
special_token_ids: Dict[str, int] = {} special_token_ids: Dict[str, int] = {}
def __init__(self, path: Path, special_token_types: Optional[Tuple[str]] = None): def __init__(self, path: Path, special_token_types: Optional[Tuple[str, ...]] = None):
self.special_token_ids = {} self.special_token_ids = {}
if special_token_types is not None: if special_token_types is not None:
self.special_token_types = special_token_types self.special_token_types = special_token_types