diff --git a/CMakeLists.txt b/CMakeLists.txt index 92329513..a1b7f4f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ endif() set(APP_VERSION_MAJOR 2) set(APP_VERSION_MINOR 4) -set(APP_VERSION_PATCH 0) +set(APP_VERSION_PATCH 1) set(APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}") # Generate a header file with the version number diff --git a/chatllm.cpp b/chatllm.cpp index 89917278..7be888b1 100644 --- a/chatllm.cpp +++ b/chatllm.cpp @@ -365,7 +365,8 @@ bool ChatLLM::serialize(QDataStream &stream) stream << quint64(m_ctx.tokens.size()); stream.writeRawData(reinterpret_cast(m_ctx.tokens.data()), m_ctx.tokens.size() * sizeof(int)); saveState(); - stream << m_state; + QByteArray compressed = qCompress(m_state); + stream << compressed; return stream.status() == QDataStream::Ok; } @@ -388,7 +389,9 @@ bool ChatLLM::deserialize(QDataStream &stream) stream >> tokensSize; m_ctx.tokens.resize(tokensSize); stream.readRawData(reinterpret_cast(m_ctx.tokens.data()), tokensSize * sizeof(int)); - stream >> m_state; + QByteArray compressed; + stream >> compressed; + m_state = qUncompress(compressed); return stream.status() == QDataStream::Ok; }