mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-30 08:42:00 +00:00 
			
		
		
		
	examples : flush log upon ctrl+c (#9559)
This commit is contained in:
		| @@ -97,6 +97,11 @@ static void sigint_handler(int signo) { | |||||||
|             LOG("\n"); |             LOG("\n"); | ||||||
|             gpt_perf_print(*g_ctx, *g_smpl); |             gpt_perf_print(*g_ctx, *g_smpl); | ||||||
|             write_logfile(*g_ctx, *g_params, *g_model, *g_input_tokens, g_output_ss->str(), *g_output_tokens); |             write_logfile(*g_ctx, *g_params, *g_model, *g_input_tokens, g_output_ss->str(), *g_output_tokens); | ||||||
|  |  | ||||||
|  |             // make sure all logs are flushed | ||||||
|  |             LOG("Interrupted by user\n"); | ||||||
|  |             gpt_log_pause(gpt_log_main()); | ||||||
|  |  | ||||||
|             _exit(130); |             _exit(130); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -116,6 +116,11 @@ static void sigint_handler(int signo) { | |||||||
|             LOG("\n"); |             LOG("\n"); | ||||||
|             gpt_perf_print(*g_ctx, *g_smpl); |             gpt_perf_print(*g_ctx, *g_smpl); | ||||||
|             write_logfile(*g_ctx, *g_params, *g_model, *g_input_tokens, g_output_ss->str(), *g_output_tokens); |             write_logfile(*g_ctx, *g_params, *g_model, *g_input_tokens, g_output_ss->str(), *g_output_tokens); | ||||||
|  |  | ||||||
|  |             // make sure all logs are flushed | ||||||
|  |             LOG("Interrupted by user\n"); | ||||||
|  |             gpt_log_pause(gpt_log_main()); | ||||||
|  |  | ||||||
|             _exit(130); |             _exit(130); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Georgi Gerganov
					Georgi Gerganov