mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-29 00:36:01 +00:00
Provide a busy indicator if we're processing a long prompt and make the
stop button work in the middle of processing a long prompt as well.
This commit is contained in:
7
llm.cpp
7
llm.cpp
@@ -65,6 +65,7 @@ bool GPTJObject::isModelLoaded() const
|
||||
void GPTJObject::resetResponse()
|
||||
{
|
||||
m_response = std::string();
|
||||
emit responseChanged();
|
||||
}
|
||||
|
||||
void GPTJObject::resetContext()
|
||||
@@ -88,8 +89,10 @@ bool GPTJObject::handleResponse(const std::string &response)
|
||||
printf("%s", response.c_str());
|
||||
fflush(stdout);
|
||||
#endif
|
||||
m_response.append(response);
|
||||
emit responseChanged();
|
||||
if (!response.empty()) {
|
||||
m_response.append(response);
|
||||
emit responseChanged();
|
||||
}
|
||||
return !m_stopGenerating;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user