Harrison/llamacpp (#5402)

Co-authored-by: Gavin S <gavinswanson@gmail.com>
searx_updates
Harrison Chase 12 months ago committed by GitHub
parent 642ae83d86
commit 3e16468423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -279,3 +279,7 @@ class LlamaCpp(LLM):
token=token, verbose=self.verbose, log_probs=log_probs
)
yield chunk
def get_num_tokens(self, text: str) -> int:
tokenized_text = self.client.tokenize(text.encode("utf-8"))
return len(tokenized_text)

Loading…
Cancel
Save