We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab58e26 commit 45ace28Copy full SHA for 45ace28
1 file changed
torchTextClassifiers/tokenizers/base.py
@@ -124,12 +124,13 @@ def tokenize(
124
125
# Pad to longest sequence if no output_dim is specified
126
padding = True if self.output_dim is None else "max_length"
127
+ truncation = True if self.output_dim is not None else False
128
129
tokenize_output = self.tokenizer(
130
text,
131
padding=padding,
132
return_tensors="pt",
- truncation=True,
133
+ truncation=truncation,
134
max_length=self.output_dim,
135
return_offsets_mapping=return_offsets_mapping,
136
) # method from PreTrainedTokenizerFast
0 commit comments