model: dbrx: convert-hf-to-gguf.py support python 3.8

This commit is contained in:
Pierrick HYMBERT 2024-04-07 17:25:39 +02:00
parent 3a9dc2eee2
commit 8154617ff2

View file

@ -416,7 +416,7 @@ class Model(ABC):
# for this kind of tokenizer, added_vocab is not a subset of vocab, so they need to be combined # for this kind of tokenizer, added_vocab is not a subset of vocab, so they need to be combined
added_vocab = tokenizer.get_added_vocab() added_vocab = tokenizer.get_added_vocab()
reverse_vocab = {id_: encoded_tok for encoded_tok, id_ in (vocab | added_vocab).items()} reverse_vocab = {id_: encoded_tok for encoded_tok, id_ in ({**vocab, **added_vocab}).items()}
for i in range(vocab_size): for i in range(vocab_size):
if i not in reverse_vocab: if i not in reverse_vocab: