From ed59190e48b686ec5d870d9ee9acaea765d9d437 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Mon, 1 May 2023 12:24:51 -0400 Subject: [PATCH] Consolidate these into single api from qml to backend. --- chat.cpp | 8 +++----- chat.h | 1 - main.qml | 2 -- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/chat.cpp b/chat.cpp index 3a330d24..f9fcbdb9 100644 --- a/chat.cpp +++ b/chat.cpp @@ -32,7 +32,10 @@ Chat::Chat(QObject *parent) void Chat::reset() { + stopGenerating(); + emit resetContextRequested(); // blocking queued connection m_id = Network::globalInstance()->generateUniqueId(); + emit idChanged(); m_chatModel->clear(); } @@ -57,11 +60,6 @@ void Chat::resetResponse() emit resetResponseRequested(); // blocking queued connection } -void Chat::resetContext() -{ - emit resetContextRequested(); // blocking queued connection -} - void Chat::stopGenerating() { m_llmodel->stopGenerating(); diff --git a/chat.h b/chat.h index 66687ee4..b68fb74c 100644 --- a/chat.h +++ b/chat.h @@ -35,7 +35,6 @@ public: float temp, int32_t n_batch, float repeat_penalty, int32_t repeat_penalty_tokens); Q_INVOKABLE void regenerateResponse(); Q_INVOKABLE void resetResponse(); - Q_INVOKABLE void resetContext(); Q_INVOKABLE void stopGenerating(); Q_INVOKABLE void syncThreadCount(); Q_INVOKABLE void setThreadCount(int32_t n_threads); diff --git a/main.qml b/main.qml index 9f6b2989..6d35c781 100644 --- a/main.qml +++ b/main.qml @@ -472,8 +472,6 @@ Window { } onClicked: { - LLM.currentChat.stopGenerating() - LLM.currentChat.resetContext() LLM.currentChat.reset(); } }