char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
cb8f4fa3f
char/aliceai-t5-moe
1// Warns users that this filename was deprecated, and provides a link for more information. 2 3#include <clocale> 4#include <cstdio> 5#include <string> 6#include <unordered_map> 7 8// Main 9int main (int argc ,char ** argv ) { 10 std::setlocale (LC_NUMERIC ,"C" ); 11 12 std::string filename = "main" ; 13if (argc >=1 ) { 14filename = argv [0 ]; 15 } 16 17// Get only the program name from the full path 18auto pos = filename .find_last_of ("/\\" ); 19if (pos != std::string::npos ) { 20filename = filename .substr (pos + 1 ); 21 } 22 23// Append "llama-" to the beginning of filename to get the replacemnt filename 24auto replacement_filename = "llama-" + filename ; 25 26// The exception is if the filename is "main", then our replacement filename is "llama-cli" 27if (filename == "main" ) { 28replacement_filename = "llama-cli" ; 29 } 30 31fprintf (stdout ,"\n" ); 32fprintf (stdout ,"WARNING: The binary '%s' is deprecated.\n" ,filename .c_str ()); 33fprintf (stdout ," Please use '%s' instead.\n" ,replacement_filename .c_str ()); 34fprintf (stdout ," See https://github.com/ggml-org/llama.cpp/tree/master/examples/deprecation-warning/README.md for more information.\n" ); 35fprintf (stdout ,"\n" ); 36 37return EXIT_FAILURE ; 38}