@@ -730,64 +730,6 @@ def if_none_convert(x, value):
730730
731731 return batch_outputs
732732
733- def encode_plus (
734- self ,
735- text : Union [TextInput , PreTokenizedInput , EncodedInput ],
736- text_pair : Optional [Union [TextInput , PreTokenizedInput , EncodedInput ]] = None ,
737- add_special_tokens : bool = True ,
738- padding : Union [bool , str , PaddingStrategy ] = False ,
739- truncation : Union [bool , str , TruncationStrategy ] = None ,
740- max_length : Optional [int ] = None ,
741- stride : int = 0 ,
742- is_split_into_words : bool = False ,
743- pad_to_multiple_of : Optional [int ] = None ,
744- return_tensors : Optional [Union [str , TensorType ]] = None ,
745- return_token_type_ids : Optional [bool ] = None ,
746- return_attention_mask : Optional [bool ] = None ,
747- return_overflowing_tokens : bool = False ,
748- return_special_tokens_mask : bool = False ,
749- return_offsets_mapping : bool = False ,
750- return_length : bool = False ,
751- verbose : bool = True ,
752- ** kwargs ,
753- ) -> BatchEncoding :
754- raise NotImplementedError
755-
756- def batch_encode_plus (
757- self ,
758- batch_text_or_text_pairs : Union [
759- List [TextInput ],
760- List [TextInputPair ],
761- List [PreTokenizedInput ],
762- List [PreTokenizedInputPair ],
763- List [EncodedInput ],
764- List [EncodedInputPair ],
765- ],
766- padding : Union [bool , str , PaddingStrategy ] = False ,
767- truncation : Union [bool , str , TruncationStrategy ] = None ,
768- max_length : Optional [int ] = None ,
769- stride : int = 0 ,
770- is_split_into_words : bool = False ,
771- pad_to_multiple_of : Optional [int ] = None ,
772- return_tensors : Optional [Union [str , TensorType ]] = None ,
773- return_token_type_ids : Optional [bool ] = None ,
774- return_attention_mask : Optional [bool ] = None ,
775- return_overflowing_tokens : bool = False ,
776- return_special_tokens_mask : bool = False ,
777- ** kwargs ,
778- ) -> BatchEncoding :
779- raise NotImplementedError
780-
781- def create_token_type_ids_from_sequences (
782- self , token_ids_0 : List [int ], token_ids_1 : Optional [List [int ]] = None
783- ) -> List [int ]:
784- raise NotImplementedError ("Implemented in C++ backend" )
785-
786- def build_inputs_with_special_tokens (
787- self , token_ids_0 : List [int ], token_ids_1 : Optional [List [int ]] = None
788- ) -> List [int ]:
789- raise NotImplementedError ("Implemented in C++ backend" )
790-
791733 def prepare_for_model (
792734 self ,
793735 ids : List [int ],
@@ -811,16 +753,6 @@ def prepare_for_model(
811753 ) -> BatchEncoding :
812754 NotImplementedError ("Implemented in C++ backend" )
813755
814- def truncate_sequences (
815- self ,
816- ids : List [int ],
817- pair_ids : Optional [List [int ]] = None ,
818- num_tokens_to_remove : int = 0 ,
819- truncation_strategy : Union [str , TruncationStrategy ] = "longest_first" ,
820- stride : int = 0 ,
821- ) -> Tuple [List [int ], List [int ], List [int ]]:
822- raise NotImplementedError ("Implemented in C++ backend" )
823-
824756 def convert_tokens_to_string (self , tokens : List [str ]) -> str :
825757 """
826758 Converts a sequence of tokens in a single string. The most simple way to do it is `" ".join(tokens)` but we
0 commit comments