File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 11#include " llama.h"
22
3+ #include < cstdio>
34#include < cstdlib>
45
56int main (void ) {
7+ auto model_path = " models/7B/ggml-model-f16.gguf" ;
8+ auto file = fopen (model_path, " r" );
9+
10+ if (file == nullptr ) {
11+ fprintf (stderr, " no model at '%s' found\n " , model_path);
12+ return EXIT_FAILURE;
13+ } else {
14+ fprintf (stderr, " using '%s'\n " , model_path);
15+ fclose (file);
16+ }
17+
618 llama_backend_init (false );
719 auto params = llama_model_params{};
820 params.use_mmap = false ;
921 params.progress_callback = [](float progress, void * ctx){
1022 (void ) ctx;
1123 return progress > 0.50 ;
1224 };
13- auto * model = llama_load_model_from_file (" models/7B/ggml-model-f16.gguf " , params);
25+ auto * model = llama_load_model_from_file (model_path , params);
1426 llama_backend_free ();
1527 return model == nullptr ? EXIT_SUCCESS : EXIT_FAILURE;
1628}
You can’t perform that action at this time.
0 commit comments