Skip to content

Commit

Permalink
Changes in llama.cpp API
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasvonderheidt committed Jan 10, 2025
1 parent 33f3d1a commit 2ec4bc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/cpp/hips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern "C" JNIEXPORT jlong JNICALL Java_org_vonderheidt_hips_utils_LlamaCpp_load
llama_model_params params = llama_model_default_params();

// Load the LLM into memory and save pointer to it
llama_model* cppModel = llama_load_model_from_file(cppPath, params);
llama_model* cppModel = llama_model_load_from_file(cppPath, params);

// Log success or error message
// Cast pointer to unsigned long and format it as hex
Expand Down Expand Up @@ -77,7 +77,7 @@ extern "C" JNIEXPORT void JNICALL Java_org_vonderheidt_hips_utils_LlamaCpp_unloa
auto cppModel = reinterpret_cast<llama_model*>(jModel);

// Unload LLM from memory
llama_free_model(cppModel);
llama_model_free(cppModel);

// Log success message
// Java long is used instead of now invalid C++ pointer, needs to formated as C++ long long to get all 64 bits
Expand Down

0 comments on commit 2ec4bc1

Please sign in to comment.