From cd14bbe08018d1e758ce5f22deaa948be8c268f9 Mon Sep 17 00:00:00 2001 From: Steffy-zxf <48793257+Steffy-zxf@users.noreply.github.com> Date: Tue, 2 Mar 2021 17:38:42 +0800 Subject: [PATCH] Fix data type error --- paddlehub/datasets/base_nlp_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddlehub/datasets/base_nlp_dataset.py b/paddlehub/datasets/base_nlp_dataset.py index c4cebdda..c9e425ad 100644 --- a/paddlehub/datasets/base_nlp_dataset.py +++ b/paddlehub/datasets/base_nlp_dataset.py @@ -276,7 +276,7 @@ class TextClassificationDataset(BaseNLPDataset, paddle.io.Dataset): if Version(paddlenlp.__version__) >= Version('2.0.0rc5'): token_type_ids = np.array(record['token_type_ids']) else: - token_type_ids = record['segment_ids'] + token_type_ids = np.array(record['segment_ids']) if 'label' in record.keys(): return input_ids, token_type_ids, np.array(record['label'], dtype=np.int64) -- GitLab