Update convert_hf_to_gguf.py

Co-authored-by: compilade <git@compilade.net>
This commit is contained in:
Molly Sophia 2024-08-12 09:12:16 +08:00
parent 7f2e370fa2
commit c6955525b4

View file

@ -2733,7 +2733,7 @@ class RwkvModel(Model):
for line in lines:
parts = line.split(' ')
assert len(parts) >= 3
_, token, token_len = int(parts[0]), ast.literal_eval(' '.join(parts[1:-1])), int(parts[-1])
token, token_len = ast.literal_eval(' '.join(parts[1:-1])), int(parts[-1])
token = token.encode("utf-8") if isinstance(token, str) else token
assert isinstance(token, bytes)
assert len(token) == token_len