From 531b470546ab6d7ba126f2f202bb16b46e62a41b Mon Sep 17 00:00:00 2001 From: Sang-Kil Park Date: Sat, 3 Feb 2024 02:08:14 +0900 Subject: [PATCH] Add `TypeError` exception for BPE vocab. --- convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert.py b/convert.py index 75c100118..7a90d6c4c 100755 --- a/convert.py +++ b/convert.py @@ -336,7 +336,7 @@ class BpeVocab: self.bpe_tokenizer = json.loads(open(str(fname_tokenizer), encoding="utf-8").read()) try: self.vocab = self.bpe_tokenizer["model"]["vocab"] - except KeyError: + except (KeyError, TypeError): self.vocab = self.bpe_tokenizer added_tokens: dict[str, int] if fname_added_tokens is not None: