char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
47f686f53
char/aliceai-t5-moe
1#include "llama.h" 2#include "common.h" 3 4#include <cstdlib> 5 6int main (int argc ,char * argv [] ) { 7auto * model_path = common_get_model_or_exit (argc ,argv ); 8auto * file = fopen (model_path ,"r" ); 9if (file == nullptr ) { 10fprintf (stderr ,"no model at '%s' found\n" ,model_path ); 11return EXIT_FAILURE ; 12 } 13 14fprintf (stderr ,"using '%s'\n" ,model_path ); 15fclose (file ); 16 17llama_backend_init (); 18auto params = llama_model_params {}; 19params .load_mode = LLAMA_LOAD_MODE_NONE ; 20params .progress_callback = [](float progress ,void * ctx ){ 21 (void )ctx ; 22return progress > 0.50 ; 23 }; 24auto * model = llama_model_load_from_file (model_path ,params ); 25llama_backend_free (); 26return model == nullptr ?EXIT_SUCCESS :EXIT_FAILURE ; 27}