mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 02:44:36 +00:00
llama : print timings on ctrl+c exit (#1021)
* print timings on ctrl+c exit * remove redundant free memory call. * add global pointer to ctx.
This commit is contained in:
parent
10f19c1121
commit
36b4f7e064
@ -25,6 +25,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static console_state con_st;
|
static console_state con_st;
|
||||||
|
static llama_context ** g_ctx;
|
||||||
|
|
||||||
static bool is_interacting = false;
|
static bool is_interacting = false;
|
||||||
|
|
||||||
@ -36,6 +37,7 @@ void sigint_handler(int signo) {
|
|||||||
if (!is_interacting) {
|
if (!is_interacting) {
|
||||||
is_interacting=true;
|
is_interacting=true;
|
||||||
} else {
|
} else {
|
||||||
|
llama_print_timings(*g_ctx);
|
||||||
_exit(130);
|
_exit(130);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -94,6 +96,7 @@ int main(int argc, char ** argv) {
|
|||||||
//bool is_prime(int n) {)";
|
//bool is_prime(int n) {)";
|
||||||
|
|
||||||
llama_context * ctx;
|
llama_context * ctx;
|
||||||
|
g_ctx = &ctx;
|
||||||
|
|
||||||
// load the model
|
// load the model
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user