Skip to content

Commit

Permalink
Fix docs (#3409)
Browse files Browse the repository at this point in the history
设置return_dict=False后才能使用idx下标,否则无法使用,运行报错。
  • Loading branch information
Wang-ck123 authored Oct 29, 2022
1 parent 1f88c41 commit 9eda9a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/data_prepare/data_preprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ paddlenlp内置的 :class:`paddlenlp.datasets.MapDataset` 的 :func:`map` 方法
def convert_examples(examples, tokenizer):
querys = [example['query'] for example in examples]
titles = [example['title'] for example in examples]
tokenized_examples = tokenizer(text=querys, text_pair=titles)
tokenized_examples = tokenizer(text=querys, text_pair=titles,return_dict=False)
# 加上label用于训练
for idx in range(len(tokenized_examples)):
Expand Down

0 comments on commit 9eda9a4

Please sign in to comment.