From e5b03be56c8f9460ac9e114069543d7f39198043 Mon Sep 17 00:00:00 2001 From: Yuanyuan Chen Date: Sat, 13 Sep 2025 11:32:53 +0800 Subject: [PATCH] Add setter to mutable properties Signed-off-by: Yuanyuan Chen --- bindings/python/py_src/tokenizers/__init__.pyi | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/bindings/python/py_src/tokenizers/__init__.pyi b/bindings/python/py_src/tokenizers/__init__.pyi index 06767075f..9b14acf2a 100644 --- a/bindings/python/py_src/tokenizers/__init__.pyi +++ b/bindings/python/py_src/tokenizers/__init__.pyi @@ -97,7 +97,7 @@ class Encoding: """ pass - def char_to_token(self, char_pos, sequence_index=0): + def char_to_token(self, char_pos, sequence_index: int = 0): """ Get the token that contains the char at the given position in the input sequence. @@ -141,7 +141,7 @@ class Encoding: pass @staticmethod - def merge(encodings, growing_offsets=True): + def merge(encodings, growing_offsets: bool = True): """ Merge the list of encodings into one final :class:`~tokenizers.Encoding` @@ -195,7 +195,7 @@ class Encoding: """ pass - def pad(self, length, direction="right", pad_id=0, pad_type_id=0, pad_token="[PAD]"): + def pad(self, length, direction: str = "right", pad_id=0, pad_type_id=0, pad_token: str = "[PAD]"): """ Pad the :class:`~tokenizers.Encoding` at the given length @@ -1067,6 +1067,10 @@ class Tokenizer: """ pass + @encode_special_tokens.setter + def encode_special_tokens(self, value: bool) -> None: + pass + @staticmethod def from_buffer(buffer): """ @@ -1261,6 +1265,10 @@ class Tokenizer: """ pass + @post_processor.setter + def post_processor(self, value) -> None: + pass + @property def pre_tokenizer(self): """ @@ -1268,6 +1276,10 @@ class Tokenizer: """ pass + @pre_tokenizer.setter + def pre_tokenizer(self, value) -> None: + pass + def save(self, path, pretty=True): """ Save the :class:`~tokenizers.Tokenizer` to the file at the given path.