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

@@ -707,6 +707,9 @@ void GPTJ::prompt(const std::string &prompt, std::function<bool(const std::strin
std::cerr << "GPT-J ERROR: Failed to process prompt\n";
return;
}
// We pass a null string to see if the user has asked us to stop...
if (!response(""))
return;
ctx.n_past += batch.size();
i = batch_end;
}