Skip to content

Commit

Permalink
Revert "Add typing.overload for convert_ids_tokens (huggingface#6637)"
Browse files Browse the repository at this point in the history
This reverts commit 87d3a5c.
  • Loading branch information
fabiocapsouza committed Nov 15, 2020
1 parent 75b58e8 commit b12503f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/transformers/tokenization_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import logging
import re
import unicodedata
from typing import Any, Dict, List, Optional, Tuple, Union, overload
from typing import Any, Dict, List, Optional, Tuple, Union

from .file_utils import add_end_docstrings
from .tokenization_utils_base import (
Expand Down Expand Up @@ -657,14 +657,6 @@ def get_special_tokens_mask(
"""
return [0] * ((len(token_ids_1) if token_ids_1 else 0) + len(token_ids_0))

@overload
def convert_ids_to_tokens(self, ids: int, skip_special_tokens: bool = False) -> str:
...

@overload
def convert_ids_to_tokens(self, ids: List[int], skip_special_tokens: bool = False) -> List[str]:
...

def convert_ids_to_tokens(
self, ids: Union[int, List[int]], skip_special_tokens: bool = False
) -> Union[str, List[str]]:
Expand Down

0 comments on commit b12503f

Please sign in to comment.