In #1970, the response callback used by processRestoreStateFromText was set to nullptr because it was never used.
In #2929, this callback is now used to properly count tokens of previous assistant replies provided by the client. (The fact that processRestoreStateFromText doesn't do this causes the "regenerate" button to not work on chats freshly loaded from disk, but it's always been that way.)
The effect of this is that GPT4All throws an unhandled std::bad_function_call exception and crashes if you try to load a chat from disk and then continue it in any way. This is a regression in the v3.3.0 release, which this PR fixes.
In #1970, the response callback used by processRestoreStateFromText was set to nullptr because it was never used.
In #2929, this callback is now used to properly count tokens of previous assistant replies provided by the client. (The fact that processRestoreStateFromText doesn't do this causes the "regenerate" button to not work on chats freshly loaded from disk, but it's always been that way.)
The effect of this is that GPT4All throws an unhandled std::bad_function_call exception and crashes if you try to load a chat from disk and then continue it in any way. This is a regression in the v3.3.0 release, which this PR fixes.