From 90e2f2d6b9f96a02db1cd22e5c450d1de4ec2ff1 Mon Sep 17 00:00:00 2001 From: littletomatodonkey Date: Mon, 22 Aug 2022 16:19:03 +0800 Subject: [PATCH] fix nlp return token_type_ids (#7289) --- ppocr/data/imaug/label_ops.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ppocr/data/imaug/label_ops.py b/ppocr/data/imaug/label_ops.py index c20eef2c..c6c8a520 100644 --- a/ppocr/data/imaug/label_ops.py +++ b/ppocr/data/imaug/label_ops.py @@ -918,7 +918,10 @@ class VQATokenLabelEncode(object): text = info["text"] encode_res = self.tokenizer.encode( - text, pad_to_max_seq_len=False, return_attention_mask=True) + text, + pad_to_max_seq_len=False, + return_attention_mask=True, + return_token_type_ids=True) if not self.add_special_ids: # TODO: use tok.all_special_ids to remove -- GitLab