MCPcopy Index your code
hub / github.com/SooLab/CGFormer / __init__

Method __init__

bert/tokenization_utils_base.py:145–159  ·  view source on GitHub ↗
(
        self,
        data: Optional[Dict[str, Any]] = None,
        encoding: Optional[Union[EncodingFast, Sequence[EncodingFast]]] = None,
        tensor_type: Union[None, str, TensorType] = None,
        prepend_batch_axis: bool = False,
    )

Source from the content-addressed store, hash-verified

143 """
144
145 def __init__(
146 self,
147 data: Optional[Dict[str, Any]] = None,
148 encoding: Optional[Union[EncodingFast, Sequence[EncodingFast]]] = None,
149 tensor_type: Union[None, str, TensorType] = None,
150 prepend_batch_axis: bool = False,
151 ):
152 super().__init__(data)
153
154 if isinstance(encoding, EncodingFast):
155 encoding = [encoding]
156
157 self._encodings = encoding
158
159 self.convert_to_tensors(tensor_type=tensor_type, prepend_batch_axis=prepend_batch_axis)
160
161 @property
162 def is_fast(self):

Callers 1

__init__Method · 0.45

Calls 1

convert_to_tensorsMethod · 0.95

Tested by

no test coverage detected