mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Adding __repr__ function and repr=True in dataclass
This commit is contained in:
parent
1a1439225a
commit
18839505d1
@ -78,7 +78,7 @@ if is_tokenizers_available():
|
||||
from tokenizers import Encoding as EncodingFast
|
||||
else:
|
||||
|
||||
@dataclass(frozen=False, eq=True)
|
||||
@dataclass(repr=True, frozen=False, eq=True)
|
||||
class AddedToken:
|
||||
"""
|
||||
AddedToken represents a token to be added to a Tokenizer An AddedToken can have special options defining the
|
||||
@ -104,6 +104,9 @@ else:
|
||||
def __str__(self):
|
||||
return self.content
|
||||
|
||||
def __repr__(self):
|
||||
return self.content
|
||||
|
||||
@dataclass
|
||||
class EncodingFast:
|
||||
"""This is dummy class because without the `tokenizers` library we don't have these objects anyway"""
|
||||
|
Loading…
Reference in New Issue
Block a user