Skip to content

Distribute and run LLMs with a single file.

Avoid crashing on llava ctrl-c

Justine Tunney5c4056538239
diff --git a/llama.cpp/llava/llava-cli.cpp b/llama.cpp/llava/llava-cli.cpp
index b855d945..e75d0f46 100644
--- a/llama.cpp/llava/llava-cli.cpp
+++ b/llama.cpp/llava/llava-cli.cpp
@@ -120,7 +120,8 @@ struct llava_context * volatile g_ctx;
static void sigint_handler(int signo) {
if (signo == SIGINT) {
printf("\n");
- llama_print_timings(g_ctx->ctx_llama);
+ if (g_ctx)
+ llama_print_timings(g_ctx->ctx_llama);
_exit(128 + SIGINT);
}
}