Tempaccnt / Termux-alpaca

This is a simple shell script to install the alpaca llama 7B model on termux for Android phones. All credits goes to the original developers of alpaca.cpp and ggml-model-q4_1.bin.
59 stars 11 forks source link

Illegal instruction #3

Open roshanravan opened 1 year ago

roshanravan commented 1 year ago

when i enter 'chat' then It loads and I get "illegal instruction ./chat"

roshanravan commented 1 year ago

is it a CPU architecture error? the device i am using is OnePlus 6T (Rooted) and should be able to handle this

Tempaccnt commented 1 year ago

no, I believe this is caused by some versions of Android 13 that restricts the access to /storage/emulated/0/Android/data

unfortunately, termux need access to that folder otherwise it will have limited functionality. one of those limits seems to be running llama.cpp and alpaca.cpp which are the base core of my script

roshanravan commented 1 year ago

But the device that I have problem is Android 10. There's something else, this device is rooted and has LSXpose. It might cause the conflict

Tempaccnt commented 1 year ago

I will try to find out the cause. unfortunately, I can't recreate it with any of my phones so I will see if any of my friends can recreate it on theirs.'

in the meantime, you could also check llama.cpp and alpaca.cpp for this error. there are many reports concerning the same issue there

roshanravan commented 1 year ago

I have three Android device and also I get that error on the one with Android 13, but at first it was working just fine

KonstantinGeist commented 9 months ago

The error happens because of a bug in Snapdragon 8. It can be solved by changing "-mcpu=native" to "-mcpu=native+nosve" in the CMakeLists.txt file. However, the current project is terminally broken because it clones and compiles the head of the llama.cpp repo which doesn't support the model format which the script downloads.

licryle commented 8 months ago

Not clean (a.k.a. llama should solve this first), but in the meantime, here's a workaround that worked for my snap 8.