aboutsummaryrefslogtreecommitdiff
path: root/examples/simple
diff options
context:
space:
mode:
Diffstat (limited to 'examples/simple')
-rw-r--r--examples/simple/simple.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/simple/simple.cpp b/examples/simple/simple.cpp
index 76f991c..fc45c93 100644
--- a/examples/simple/simple.cpp
+++ b/examples/simple/simple.cpp
@@ -68,11 +68,12 @@ int main(int argc, char ** argv)
llama_init_backend();
- llama_context * ctx ;
+ llama_model * model;
+ llama_context * ctx;
- ctx = llama_init_from_gpt_params( params );
+ std::tie(model, ctx) = llama_init_from_gpt_params( params );
- if ( ctx == NULL )
+ if ( model == NULL )
{
fprintf( stderr , "%s: error: unable to load model\n" , __func__ );
return 1;
@@ -170,6 +171,7 @@ int main(int argc, char ** argv)
} // wend of main loop
llama_free( ctx );
+ llama_free_model( model );
return 0;
}