Skip to content

Commit c601e4e

Browse files
committed
fix
Signed-off-by: Alexandros Koumparoulis <[email protected]>
1 parent b392165 commit c601e4e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nemo/collections/common/tokenizers/tokenizer_spec.py

+7
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,36 @@ class TokenizerSpec(ABC):
2626

2727
@abstractmethod
2828
def text_to_tokens(self, text):
29+
""" Converts text into a list of tokens. """
2930
pass
3031

3132
@abstractmethod
3233
def tokens_to_text(self, tokens):
34+
""" Converts a list of tokens back into text. """
3335
pass
3436

3537
@abstractmethod
3638
def tokens_to_ids(self, tokens):
39+
""" Converts a list of tokens to their corresponding IDs. """
3740
pass
3841

3942
@abstractmethod
4043
def ids_to_tokens(self, ids):
44+
""" Converts a list of token IDs back to tokens. """
4145
pass
4246

4347
@abstractmethod
4448
def text_to_ids(self, text):
49+
""" Converts text directly to token IDs. """
4550
pass
4651

4752
@abstractmethod
4853
def ids_to_text(self, ids):
54+
""" Converts token IDs back to text. """
4955
pass
5056

5157
def add_special_tokens(self, special_tokens: List[str]):
58+
""" Adds special tokens (eos, pad, cls...) to vocab. """
5259
raise NotImplementedError("To be implemented")
5360

5461
def apply_chat_template(self, *args, **kwargs):

0 commit comments

Comments
 (0)