Fix llama.cpp double decoding

This commit is contained in:
oobabooga 2023-09-17 13:07:48 -07:00
parent 230b562d53
commit d9b0f2c9c3

View File

@ -116,7 +116,7 @@ class LlamaCppModel:
# Handle truncation # Handle truncation
prompt = self.encode(prompt) prompt = self.encode(prompt)
prompt = prompt[-get_max_prompt_length(state):] prompt = prompt[-get_max_prompt_length(state):]
prompt = self.decode(prompt).decode('utf-8') prompt = self.decode(prompt)
logit_processors = LogitsProcessorList() logit_processors = LogitsProcessorList()
if state['ban_eos_token']: if state['ban_eos_token']: