File tree 1 file changed +1
-13
lines changed 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change 1
1
#include " llama.h"
2
2
3
- #include < cstdio>
4
3
#include < cstdlib>
5
4
6
5
int 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
-
18
6
llama_backend_init (false );
19
7
auto params = llama_model_params{};
20
8
params.use_mmap = false ;
21
9
params.progress_callback = [](float progress, void * ctx){
22
10
(void ) ctx;
23
11
return progress > 0.50 ;
24
12
};
25
- auto * model = llama_load_model_from_file (model_path , params);
13
+ auto * model = llama_load_model_from_file (" models/7B/ggml-model-f16.gguf " , params);
26
14
llama_backend_free ();
27
15
return model == nullptr ? EXIT_SUCCESS : EXIT_FAILURE;
28
16
}
You can’t perform that action at this time.
0 commit comments