py : fix except (#5194)

ggml-ci
This commit is contained in:
Georgi Gerganov 2024-01-29 15:35:54 +02:00 committed by GitHub
parent e76627bcce
commit 14fef85e2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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:
except KeyError:
self.vocab = self.bpe_tokenizer
added_tokens: dict[str, int]
if fname_added_tokens is not None: