aboutsummaryrefslogtreecommitdiff
path: root/examples/perplexity
diff options
context:
space:
mode:
Diffstat (limited to 'examples/perplexity')
-rw-r--r--examples/perplexity/perplexity.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/perplexity/perplexity.cpp b/examples/perplexity/perplexity.cpp
index ae8cfe0..b59f597 100644
--- a/examples/perplexity/perplexity.cpp
+++ b/examples/perplexity/perplexity.cpp
@@ -149,11 +149,12 @@ int main(int argc, char ** argv) {
llama_init_backend();
+ llama_model * model;
llama_context * ctx;
// load the model and apply lora adapter, if any
- ctx = llama_init_from_gpt_params(params);
- if (ctx == NULL) {
+ std::tie(model, ctx) = llama_init_from_gpt_params(params);
+ if (model == NULL) {
fprintf(stderr, "%s: error: unable to load model\n", __func__);
return 1;
}
@@ -169,6 +170,7 @@ int main(int argc, char ** argv) {
llama_print_timings(ctx);
llama_free(ctx);
+ llama_free_model(model);
return 0;
}