Added UnicodeDecodeError workaround for modules/llamacpp_model.py

This commit is contained in:
nclok1405 2024-05-22 09:54:35 +09:00
parent 8aaa0a6f4e
commit 39db799bf1

View File

@ -114,7 +114,7 @@ class LlamaCppModel:
return self.model.tokenize(string)
def decode(self, ids, **kwargs):
return self.model.detokenize(ids).decode('utf-8')
return self.model.detokenize(ids).decode('utf-8', 'replace')
def get_logits(self, tokens):
self.model.reset()