Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print timings on ctrl+c exit #1021

Merged
merged 3 commits into from
Apr 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion examples/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#endif

static console_state con_st;
static llama_context ** g_ctx;

static bool is_interacting = false;

Expand All @@ -36,6 +37,7 @@ void sigint_handler(int signo) {
if (!is_interacting) {
is_interacting=true;
} else {
llama_print_timings(*g_ctx);
_exit(130);
}
}
Expand Down Expand Up @@ -92,8 +94,9 @@ int main(int argc, char ** argv) {

// params.prompt = R"(// this function checks if the number n is prime
//bool is_prime(int n) {)";

llama_context * ctx;
g_ctx = &ctx;

// load the model
{
Expand Down