Skip to content

Commit

Permalink
chatllm: use a better prompt for the generated chat name (#2322)
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
  • Loading branch information
cebtenzzre committed May 9, 2024
1 parent f26e8d0 commit 5fb9d17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gpt4all-chat/chatllm.cpp
Expand Up @@ -782,13 +782,13 @@ void ChatLLM::generateName()
if (!isModelLoaded())
return;

std::string instructPrompt("### Instruction:\n%1\n### Response:\n"); // standard Alpaca
auto promptTemplate = MySettings::globalInstance()->modelPromptTemplate(m_modelInfo);
auto promptFunc = std::bind(&ChatLLM::handleNamePrompt, this, std::placeholders::_1);
auto responseFunc = std::bind(&ChatLLM::handleNameResponse, this, std::placeholders::_1, std::placeholders::_2);
auto recalcFunc = std::bind(&ChatLLM::handleNameRecalculate, this, std::placeholders::_1);
LLModel::PromptContext ctx = m_ctx;
m_llModelInfo.model->prompt("Describe response above in three words.", instructPrompt, promptFunc, responseFunc,
recalcFunc, ctx);
m_llModelInfo.model->prompt("Describe the above conversation in three words or less.",
promptTemplate.toStdString(), promptFunc, responseFunc, recalcFunc, ctx);
std::string trimmed = trim_whitespace(m_nameResponse);
if (trimmed != m_nameResponse) {
m_nameResponse = trimmed;
Expand Down

0 comments on commit 5fb9d17

Please sign in to comment.