Tokenization improvements

This commit is contained in:
oobabooga 2023-09-17 07:01:34 -07:00
parent cd08eb0753
commit ad8ac545a5
5 changed files with 19 additions and 15 deletions

View file

@ -98,8 +98,8 @@ class LlamaCppModel:
return self.model.tokenize(string)
def decode(self, tokens):
return self.model.detokenize(tokens)
def decode(self, ids):
return self.model.detokenize(ids).decode('utf-8')
def get_logits(self, tokens):
self.model.eval(tokens)