From 24dd27ea998d873e21776bf8559663c491ddc5fc Mon Sep 17 00:00:00 2001 From: Hemanth <44165523+Hemanth21k@users.noreply.github.com> Date: Mon, 11 Oct 2021 19:11:55 +0530 Subject: [PATCH] Update pipelines.py Fixed substring not found error by keeping skip_special_tokens=True for ans_tokenizer.decode in _extract answers. --- pipelines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipelines.py b/pipelines.py index 2c9c681..b7b50b1 100644 --- a/pipelines.py +++ b/pipelines.py @@ -87,7 +87,7 @@ def _extract_answers(self, context): max_length=32, ) - dec = [self.ans_tokenizer.decode(ids, skip_special_tokens=False) for ids in outs] + dec = [self.ans_tokenizer.decode(ids, skip_special_tokens=True) for ids in outs] answers = [item.split('') for item in dec] answers = [i[:-1] for i in answers]