From 031d7149a7fdeb7c44d7204610a070f1186c2100 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Thu, 1 Jun 2023 17:34:13 -0400 Subject: [PATCH] Fix bug with resetting context with chatgpt model. --- gpt4all-chat/chatllm.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gpt4all-chat/chatllm.cpp b/gpt4all-chat/chatllm.cpp index 51c06f00..4804d492 100644 --- a/gpt4all-chat/chatllm.cpp +++ b/gpt4all-chat/chatllm.cpp @@ -297,6 +297,10 @@ void ChatLLM::resetResponse() void ChatLLM::resetContext() { regenerateResponse(); + if (m_isChatGPT && isModelLoaded()) { + ChatGPT *chatGPT = static_cast(m_modelInfo.model); + chatGPT->setContext(QList()); + } m_ctx = LLModel::PromptContext(); }