char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
fedf034a9
char/aliceai-t5-moe
1#include "ggml-impl.h" 2 3#include <cstdlib> 4#include <exception> 5 6static std::terminate_handler previous_terminate_handler ; 7 8GGML_NORETURN static void ggml_uncaught_exception () { 9ggml_print_backtrace (); 10if (previous_terminate_handler ) { 11previous_terminate_handler (); 12 } 13abort ();// unreachable unless previous_terminate_handler was nullptr 14} 15 16static bool ggml_uncaught_exception_init = []{ 17const char * GGML_NO_BACKTRACE = getenv ("GGML_NO_BACKTRACE" ); 18if (GGML_NO_BACKTRACE ) { 19return false; 20 } 21const auto prev {std::get_terminate ()}; 22GGML_ASSERT (prev != ggml_uncaught_exception ); 23previous_terminate_handler = prev ; 24 std::set_terminate (ggml_uncaught_exception ); 25return true; 26}();