From 02e13737f39931ece163e2cb270132de2c892d06 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Sun, 9 Apr 2023 01:11:52 -0400 Subject: [PATCH] Don't repeat the prompt in the response. --- gptj.cpp | 7 +++++-- main.qml | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gptj.cpp b/gptj.cpp index 0858e944..612b1a34 100644 --- a/gptj.cpp +++ b/gptj.cpp @@ -700,6 +700,7 @@ void GPTJ::prompt(const std::string &prompt, std::functionmodel.hparams.n_ctx - (int) embd_inp.size()); std::vector embd; + std::vector resp; // determine the required inference memory per token: size_t mem_per_token = 0; @@ -720,6 +721,7 @@ void GPTJ::prompt(const std::string &prompt, std::function= embd_inp.size()) { // sample next token @@ -738,6 +740,7 @@ void GPTJ::prompt(const std::string &prompt, std::functionvocab.id_to_token[id])) goto stop_generating; } @@ -762,7 +765,7 @@ void GPTJ::prompt(const std::string &prompt, std::function