Open LandonPatmore opened 1 week ago
I am assuming that you are working with the android example. On a quick glance to llama-android.cpp
, there are some issues with Java_android_llama_cpp_LLamaAndroid_free_1batch
. Since it allocates the batches itself in Java_android_llama_cpp_LLamaAndroid_new_1batch
, it should also free it itself rather than calling the llama.cpp library function, which may be linked to a different version of the standard library. Additionally, it does not free the llama_batch
object, and that will cause a leak. I am not sure if that's the cause of your crashes, but it's something you could look into.
What happened?
Looks like trying to call
unload()
anywhere within the app causes a native crash. Not sure why it is happening. Confirmed across both our app, as well as the sample app by adding a clear model button that calls:Which underneath is calling:
Currently running on a Pixel 8, but I don't believe the type of device is the cause. This means that once you load one model, you cannot load anymore, until you close the app.
Name and Version
Android: 14 build number AP2A.240905.003.B1 Mac OS: 14.7 (23H124) Chip: Apple M3 Max
Commit head: 9e041024481f6b249ab8918e18b9477f873b5a5e
What operating system are you seeing the problem on?
Other? (Please let us know in description)
Relevant log output
If you need more info, let me know, thanks for the library it works great otherwise!