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:
Adam Treat
2023-04-12 11:39:43 -04:00
parent 89dff7812b
commit c183702aa4
3 changed files with 18 additions and 3 deletions

View File

@@ -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;
}