diff --git a/gpt4all-chat/CHANGELOG.md b/gpt4all-chat/CHANGELOG.md index 7de937b9..00be433a 100644 --- a/gpt4all-chat/CHANGELOG.md +++ b/gpt4all-chat/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Fixed - Fix several potential crashes ([#3465](https://github.com/nomic-ai/gpt4all/pull/3465)) +- Fix visual spacing issues with deepseek models ([#3470](https://github.com/nomic-ai/gpt4all/pull/3470)) ## [3.9.0] - 2025-02-04 diff --git a/gpt4all-chat/qml/ChatItemView.qml b/gpt4all-chat/qml/ChatItemView.qml index 90e09bcb..09f070ae 100644 --- a/gpt4all-chat/qml/ChatItemView.qml +++ b/gpt4all-chat/qml/ChatItemView.qml @@ -198,6 +198,7 @@ GridLayout { isError: false isThinking: true thinkingTime: modelData.thinkingTime + visible: modelData.content !== "" } } } diff --git a/gpt4all-chat/src/chatllm.cpp b/gpt4all-chat/src/chatllm.cpp index 8bca1143..c962fcd2 100644 --- a/gpt4all-chat/src/chatllm.cpp +++ b/gpt4all-chat/src/chatllm.cpp @@ -976,7 +976,8 @@ public: { Q_UNUSED(bufferIdx) try { - m_cllm->m_chatModel->setResponseValue(response); + QString r = response; + m_cllm->m_chatModel->setResponseValue(removeLeadingWhitespace(r)); } catch (const std::exception &e) { // We have a try/catch here because the main thread might have removed the response from // the chatmodel by erasing the conversation during the response... the main thread sets @@ -991,7 +992,7 @@ public: bool onRegularResponse() override { auto respStr = QString::fromUtf8(m_result->response); - return onBufferResponse(removeLeadingWhitespace(respStr), 0); + return onBufferResponse(respStr, 0); } bool getStopGenerating() const override @@ -1078,7 +1079,7 @@ auto ChatLLM::promptInternal( auto respStr = QString::fromUtf8(result.response); if (!respStr.isEmpty() && (std::as_const(respStr).back().isSpace() || finalBuffers.size() > 1)) { if (finalBuffers.size() > 1) - m_chatModel->setResponseValue(finalBuffers.last()); + m_chatModel->setResponseValue(finalBuffers.last().trimmed()); else m_chatModel->setResponseValue(respStr.trimmed()); emit responseChanged();