mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-06 09:20:33 +00:00
Only generate three words max.
This commit is contained in:
parent
2b76fa6b20
commit
da5b057041
@ -356,9 +356,13 @@ bool ChatLLM::handleNamePrompt(int32_t token)
|
|||||||
bool ChatLLM::handleNameResponse(int32_t token, const std::string &response)
|
bool ChatLLM::handleNameResponse(int32_t token, const std::string &response)
|
||||||
{
|
{
|
||||||
Q_UNUSED(token);
|
Q_UNUSED(token);
|
||||||
|
|
||||||
m_nameResponse.append(response);
|
m_nameResponse.append(response);
|
||||||
emit generatedNameChanged();
|
emit generatedNameChanged();
|
||||||
return true;
|
QString gen = QString::fromStdString(m_nameResponse).simplified();
|
||||||
|
QStringList words = gen.split(' ', Qt::SkipEmptyParts);
|
||||||
|
int wordCount = words.size();
|
||||||
|
return words.size() <= 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChatLLM::handleNameRecalculate(bool isRecalc)
|
bool ChatLLM::handleNameRecalculate(bool isRecalc)
|
||||||
|
Loading…
Reference in New Issue
Block a user