mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-07-05 19:46:30 +00:00
Fix system prompt.
This commit is contained in:
parent
34555c4934
commit
9e27a118ed
@ -917,11 +917,11 @@ void ChatLLM::restoreState()
|
|||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
qDebug() << "restoreState" << m_llmThread.objectName() << "size:" << m_state.size();
|
qDebug() << "restoreState" << m_llmThread.objectName() << "size:" << m_state.size();
|
||||||
#endif
|
#endif
|
||||||
m_processedSystemPrompt = true;
|
|
||||||
|
|
||||||
if (m_state.isEmpty())
|
if (m_state.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
m_processedSystemPrompt = true;
|
||||||
m_llModelInfo.model->restoreState(static_cast<const uint8_t*>(reinterpret_cast<void*>(m_state.data())));
|
m_llModelInfo.model->restoreState(static_cast<const uint8_t*>(reinterpret_cast<void*>(m_state.data())));
|
||||||
m_state.clear();
|
m_state.clear();
|
||||||
m_state.resize(0);
|
m_state.resize(0);
|
||||||
@ -930,7 +930,7 @@ void ChatLLM::restoreState()
|
|||||||
void ChatLLM::processSystemPrompt()
|
void ChatLLM::processSystemPrompt()
|
||||||
{
|
{
|
||||||
Q_ASSERT(isModelLoaded());
|
Q_ASSERT(isModelLoaded());
|
||||||
if (!isModelLoaded() || m_processedSystemPrompt || m_isServer)
|
if (!isModelLoaded() || m_processedSystemPrompt || m_restoreStateFromText || m_isServer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const std::string systemPrompt = MySettings::globalInstance()->modelSystemPrompt(m_modelInfo).toStdString();
|
const std::string systemPrompt = MySettings::globalInstance()->modelSystemPrompt(m_modelInfo).toStdString();
|
||||||
@ -974,7 +974,7 @@ void ChatLLM::processSystemPrompt()
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_processedSystemPrompt = !m_stopGenerating;
|
m_processedSystemPrompt = m_stopGenerating == false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatLLM::processRestoreStateFromText()
|
void ChatLLM::processRestoreStateFromText()
|
||||||
|
Loading…
Reference in New Issue
Block a user