From f986c65a4eed8540ddac7401ad612f81fcc3f1db Mon Sep 17 00:00:00 2001 From: Gnome Ann <> Date: Fri, 20 Aug 2021 11:15:32 -0400 Subject: [PATCH] Manually strip and decode tokens if not using a pipeline --- aiserver.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aiserver.py b/aiserver.py index a8f65445..40e7c602 100644 --- a/aiserver.py +++ b/aiserver.py @@ -1109,6 +1109,10 @@ def generate(txt, min, max): set_aibusy(0) return + # Need to manually strip and decode tokens if we're not using a pipeline + if(vars.hascuda and vars.breakmodel): + genout = [{"generated_text": tokenizer.decode(tokens[len(gen_in[0])-len(tokens):])} for tokens in genout] + if(len(genout) == 1): genresult(genout[0]["generated_text"]) else: