From b60e6fd5f542f04f11f6b7f09c0f079dba8e7307 Mon Sep 17 00:00:00 2001 From: wangxiao1021 Date: Thu, 20 Feb 2020 11:00:56 +0800 Subject: [PATCH] fix bugs --- paddlepalm/reader/utils/reader4ernie.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/paddlepalm/reader/utils/reader4ernie.py b/paddlepalm/reader/utils/reader4ernie.py index c263ba2..d3f7eb2 100644 --- a/paddlepalm/reader/utils/reader4ernie.py +++ b/paddlepalm/reader/utils/reader4ernie.py @@ -293,10 +293,9 @@ class Reader(object): if to_append: batch_records.append(record) else: - ds = ['s'] * 7 - for piece in palm.distribute.yield_pieces(\ - self._pad_batch_records(batch_records), - ds, batch_size): + batch_pad_records = self._pad_batch_records(batch_records) + ds = ['s'] * len(batch_pad_records) + for piece in palm.distribute.yield_pieces(batch_pad_records, ds, batch_size): yield piece batch_records, max_len = [record], len(record.token_ids) -- GitLab