Add TypeError
exception for BPE vocab.
This commit is contained in:
parent
191221178f
commit
531b470546
1 changed files with 1 additions and 1 deletions
|
@ -336,7 +336,7 @@ class BpeVocab:
|
||||||
self.bpe_tokenizer = json.loads(open(str(fname_tokenizer), encoding="utf-8").read())
|
self.bpe_tokenizer = json.loads(open(str(fname_tokenizer), encoding="utf-8").read())
|
||||||
try:
|
try:
|
||||||
self.vocab = self.bpe_tokenizer["model"]["vocab"]
|
self.vocab = self.bpe_tokenizer["model"]["vocab"]
|
||||||
except KeyError:
|
except (KeyError, TypeError):
|
||||||
self.vocab = self.bpe_tokenizer
|
self.vocab = self.bpe_tokenizer
|
||||||
added_tokens: dict[str, int]
|
added_tokens: dict[str, int]
|
||||||
if fname_added_tokens is not None:
|
if fname_added_tokens is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue