Implement the first real test of gpt4all-chat (#3116)

Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
Jared Van Bortel
2024-10-20 11:38:04 -04:00
committed by GitHub
parent 9cafd38dcf
commit 7f5f0869e7
14 changed files with 157 additions and 13 deletions

View File

@@ -26,6 +26,8 @@
#ifdef Q_OS_WINDOWS
# include <windows.h>
#else
# include <signal.h>
#endif
using namespace Qt::Literals::StringLiterals;
@@ -130,6 +132,17 @@ int main(int argc, char *argv[])
}
#endif
#ifndef Q_OS_WINDOWS
// handle signals gracefully
struct sigaction sa;
sa.sa_handler = [](int s) { QCoreApplication::exit(s == SIGINT ? 0 : 1); };
sa.sa_flags = SA_RESETHAND;
sigemptyset(&sa.sa_mask);
sigaction(SIGINT, &sa, nullptr);
sigaction(SIGTERM, &sa, nullptr);
sigaction(SIGHUP, &sa, nullptr);
#endif
int res = app.exec();
// Make sure ChatLLM threads are joined before global destructors run.