From d9b0f2c9c3a66deab83599670f8565e16d14b3f1 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 17 Sep 2023 13:07:48 -0700 Subject: [PATCH] Fix llama.cpp double decoding --- modules/llamacpp_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/llamacpp_model.py b/modules/llamacpp_model.py index ed1f5b9e..44bb61f7 100644 --- a/modules/llamacpp_model.py +++ b/modules/llamacpp_model.py @@ -116,7 +116,7 @@ class LlamaCppModel: # Handle truncation prompt = self.encode(prompt) prompt = prompt[-get_max_prompt_length(state):] - prompt = self.decode(prompt).decode('utf-8') + prompt = self.decode(prompt) logit_processors = LogitsProcessorList() if state['ban_eos_token']: