Update convert-hf-to-gguf.py
Co-authored-by: Jared Van Bortel <cebtenzzre@gmail.com>
This commit is contained in:
parent
7218c7b613
commit
e3efcf13c8
1 changed files with 3 additions and 4 deletions
|
@ -1666,12 +1666,11 @@ class BertModel(Model):
|
|||
|
||||
# convert to phantom space vocab
|
||||
def phantom(tok, typ):
|
||||
if tok.startswith(b'[') and tok.endswith(b']'):
|
||||
if tok.startswith(b"[") and tok.endswith(b"]"):
|
||||
return tok
|
||||
elif tok.startswith(b"##"):
|
||||
if tok.startswith(b"##"):
|
||||
return tok[2:]
|
||||
else:
|
||||
return b"\xe2\x96\x81" + tok
|
||||
return b"\xe2\x96\x81" + tok
|
||||
tokens = [phantom(t, y) for t, y in zip(tokens, toktypes)]
|
||||
|
||||
# set up bos and eos tokens (cls and sep)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue