fix nlp return token_type_ids (#7289)

pull/7405/head
littletomatodonkey 2022-08-22 16:19:03 +08:00 committed by GitHub
parent a40f64a70b
commit 90e2f2d6b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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