Skip to content

Commit dd771b4

Browse files
committed
fix bugs in encode_sentences
1 parent 3f9f981 commit dd771b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tkseem/_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def encode_sentences(self, sentences, boundries=None, out_length=None):
389389
pad_id = self.token_to_id(self.pad_token)
390390
for i in range(len(encodings)):
391391
encodings[i] = self.pad(encodings[i], max_length)[:out_length]
392-
if encodings[i][-1] != pad_id:
392+
if encodings[i][-1] != pad_id and boundries:
393393
encodings[i][-1] = self.token_to_id(boundries[1])
394394

395395
return np.array(encodings)

0 commit comments

Comments
 (0)