Skip to content

Commit b040e6e

Browse files
authored
Fix None in add_token_positions - issue huggingface#10210 (huggingface#10374)
* Fix None in add_token_positions - issue huggingface#10210 Fix None in add_token_positions related to the issue huggingface#10210 * add_token_positions fix None values in end_positions vector add_token_positions fix None in end_positions vector as proposed by @joeddav
1 parent 9d14be5 commit b040e6e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

docs/source/custom_datasets.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ we can use the built in :func:`~transformers.BatchEncoding.char_to_token` method
563563
# if start position is None, the answer passage has been truncated
564564
if start_positions[-1] is None:
565565
start_positions[-1] = tokenizer.model_max_length
566+
if end_positions[-1] is None:
566567
end_positions[-1] = tokenizer.model_max_length
567568
568569
encodings.update({'start_positions': start_positions, 'end_positions': end_positions})

0 commit comments

Comments
 (0)