Text Generation
Russian
conversational

Avoid printing incomplete bytes

#1
by fikavec - opened
This comment has been hidden

for token in generator:
# detokenize function may return incomplete bytes (not for printing), because one letter can consist of several tokens - see what we can make with it there: https://abetlen.github.io/llama-cpp-python/#__codelineno-0-673
# errors="ignore" - just simple trick to avoid exception
token_str = model.detokenize([token]).decode("utf-8", errors="ignore")

fikavec changed pull request status to closed

Sign up or log in to comment