From c052dc670753dedf93e18d9891501b9844198b8e Mon Sep 17 00:00:00 2001 From: KP <109694228@qq.com> Date: Thu, 22 Jul 2021 14:28:39 +0800 Subject: [PATCH] Fix ernie_gen training error in windows device (#1540) --- modules/text/text_generation/ernie_gen/encode.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/text/text_generation/ernie_gen/encode.py b/modules/text/text_generation/ernie_gen/encode.py index c4fb9b07..370ba000 100644 --- a/modules/text/text_generation/ernie_gen/encode.py +++ b/modules/text/text_generation/ernie_gen/encode.py @@ -54,7 +54,8 @@ def convert_example(tokenizer, else: tgt_labels = tgt_ids - return (src_ids, src_pids, src_sids, tgt_ids, tgt_pids, tgt_sids, attn_ids, tgt_labels) + return [np.asarray(item, dtype=np.int64) for item \ + in [src_ids, src_pids, src_sids, tgt_ids, tgt_pids, tgt_sids, attn_ids, tgt_labels]] return warpper -- GitLab