mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-10-01 01:06:10 -04:00
Use different language for prompt size too large. (#3004)
Signed-off-by: Adam Treat <treat.adam@gmail.com> Signed-off-by: Jared Van Bortel <jared@nomic.ai> Co-authored-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
f9d6be8afb
commit
ea1ade8668
@ -161,7 +161,9 @@ bool LLModel::decodePrompt(std::function<bool(int32_t)> promptCallback,
|
|||||||
std::vector<Token> embd_inp,
|
std::vector<Token> embd_inp,
|
||||||
bool isResponse) {
|
bool isResponse) {
|
||||||
if ((int) embd_inp.size() > promptCtx.n_ctx - 4) {
|
if ((int) embd_inp.size() > promptCtx.n_ctx - 4) {
|
||||||
responseCallback(-1, "ERROR: The prompt size exceeds the context window size and cannot be processed.");
|
// FIXME: (Adam) We should find a way to bubble these strings to the UI level to allow for
|
||||||
|
// translation
|
||||||
|
responseCallback(-1, "Your message was too long and could not be processed. Please try again with something shorter.");
|
||||||
std::cerr << implementation().modelType() << " ERROR: The prompt is " << embd_inp.size() <<
|
std::cerr << implementation().modelType() << " ERROR: The prompt is " << embd_inp.size() <<
|
||||||
" tokens and the context window is " << promptCtx.n_ctx << "!\n";
|
" tokens and the context window is " << promptCtx.n_ctx << "!\n";
|
||||||
return false;
|
return false;
|
||||||
|
@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Rebase llama.cpp on latest upstream as of September 26th ([#2998](https://github.com/nomic-ai/gpt4all/pull/2998))
|
- Rebase llama.cpp on latest upstream as of September 26th ([#2998](https://github.com/nomic-ai/gpt4all/pull/2998))
|
||||||
|
- Change the error message when a message is too long ([#3004](https://github.com/nomic-ai/gpt4all/pull/3004))
|
||||||
|
|
||||||
## [2.8.2] - 2024-08-14
|
## [2.8.2] - 2024-08-14
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Rebase llama.cpp on latest upstream as of September 26th ([#2998](https://github.com/nomic-ai/gpt4all/pull/2998))
|
- Rebase llama.cpp on latest upstream as of September 26th ([#2998](https://github.com/nomic-ai/gpt4all/pull/2998))
|
||||||
|
- Change the error message when a message is too long ([#3004](https://github.com/nomic-ai/gpt4all/pull/3004))
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Fix a crash when attempting to continue a chat loaded from disk ([#2995](https://github.com/nomic-ai/gpt4all/pull/2995))
|
- Fix a crash when attempting to continue a chat loaded from disk ([#2995](https://github.com/nomic-ai/gpt4all/pull/2995))
|
||||||
|
@ -706,6 +706,9 @@ bool ChatLLM::handleResponse(int32_t token, const std::string &response)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// check for error
|
// check for error
|
||||||
|
// FIXME (Adam) The error messages should not be treated as a model response or part of the
|
||||||
|
// normal conversation. They should be serialized along with the conversation, but the strings
|
||||||
|
// are separate and we should preserve info that these are error messages and not actual model responses.
|
||||||
if (token < 0) {
|
if (token < 0) {
|
||||||
m_response.append(response);
|
m_response.append(response);
|
||||||
m_trimmedResponse = remove_leading_whitespace(m_response);
|
m_trimmedResponse = remove_leading_whitespace(m_response);
|
||||||
|
Loading…
Reference in New Issue
Block a user