Failed to load OmniNeural-4B-Mobile on Samsung S25 Ultra
I am trying to deploy OmniNeural- 4B on Android smartphones with Qualcomm Snapdragon 8 Elite SoC such as Samsung S25 Ultra. I am following the instruction in Nexa Android SDK (https://docs.nexa.ai/nexa-sdk-android/quickstart) but always end up errors during loading such as Model create() failed error code xxxx. The same goes with other models that are intended for mobile NPU. I am using the latest SDK (version 0.0.11) and Android Studio for building.
Is it running in a new project or in the demo? What are model_path and error code?
It is based on the Android SDK Demo here (https://github.com/NexaAI/nexa-sdk/tree/main/bindings/android). I made modifications according to instructions here https://docs.nexa.ai/nexa-sdk-android/quickstart.
Once I gave the model_path explicitly, and defined as: "/data/data/com.nexa.demo/files/models/omni-neural-4b".
Another time I defined the model_path parametric, e.g. "$filesDir/models/omni-neural-4b", which is basically equivalent to the above.
I downloaded the model files (from this HuggingFace link https://huggingface.co/NexaAI/OmniNeural-4B-mobile/tree/main), and stored in the assets folder (assets/models/omni-neural-4b).
I also wrote a custom load function to load the model files from asset folder to the model_path, and checked that it correctly loads the 8 weight files, three attachment files, and a file with name files-1-1.nexa
In all above cases, with and without the custom load function, I get an error when pushing the load button in the app. The error looks like this "Model create() failed, error code: -1071584104".
I also tried to download the models files through the app, and then load. Same error when pushing the load button.
In the Android SDK demo, the model_path should be set to /data/data/com.nexa.demo/files/models/OmniNeural-4B/files-1-1.nexa Or use selectModelData.modelFile(this@MainActivity)!! .getAbsolutePath() .Try this and see if it works.We will update the instructions.
I tried both options. No success. Model create() failed, error code 1052810392.
Is your file structure like this?
/data/data/com.nexa.demo/files/models/OmniNeural-4B/
------ attachments-1-3.nexa
------ attachments-2-3.nexa
------ attachments-3-3.nexa
------ files-1-1.nexa
------ nexa.manifest
------ weights-1-8.nexa
------ weights-2-8.nexa
------ weights-3-8.nexa
------ weights-4-8.nexa
------ weights-5-8.nexa
------ weights-6-8.nexa
------ weights-7-8.nexa
------ weights-8-8.nexa
Yes. Exactly. I attach my structure
Has the code of the demo (https://github.com/NexaAI/nexa-sdk/tree/main/bindings/android) been modified? I haven't been able to reproduce it yet and it might take some time.
The only change I made is here (according to given instructions): Another change was to disable the download option when loading the model directly from assets.(spDownloaded.edit().putBoolean("OmniNeural-4B", true).commit())
Is it possible for you to share a working apk?
You can download app-debug.apk from https://oc1rr3jgj3d.sg.larksuite.com/file/UIg9bca2woBhlWxiZmdlb5D5gRe?from=from_copylink
I tried your shared apk. Tested on Samsung S25 Ultra (with Qualcomm Gen 4 SoC). Gives error when trying to load the model.
Further information when trying your shared apk. I found that after downloading the model, one file is missing, that is, files-1-1.nexa. Then I checked in model_list.json and found that the model URL for OmniNeural-4B points to a wrong file (files-1-2.nexa): "modelUrl": "https://nexa-model-hub-bucket.s3.us-west-1.amazonaws.com/public/nexa_sdk/huggingface-models/parakeet-tdt-0.6b-v3-npu-mobile/files-1-2.nexa"
Anyway, I knew about this bug before and fixed it, yet it did not resolve the load issue. Maybe you could update your apk with this fixation and see if it works on your end. At the moment, none of the models in your apk, except for the gguf one, works on my side.
OmniNeural- 4B's modelUrl is "https://nexa-model-hub-bucket.s3.us-west-1.amazonaws.com/public/nexa_sdk/huggingface-models/OmniNeural-4B-mobile/files-1-1.nexa". Could it be that there is a problem with the downloaded file? Let's first download it via the computer, and then use adb push to import the model file into the phone.
Have you rooted your phone and is it using the official system?
I checked on both rooted and non-rooted devices. No difference in errors.
Question is: can you run the apk on your own devices or not?
Yes, I tried the Samsung S25 and the nubia Z70 Ultra, and both of them worked properly. The Nubia Z70 Ultra and the Samsung S25 Ultra have same Soc.
It seems that I need to try out a Samsung S25 Ultra.
Strange! Your model url was pointing to a wrong one (files-1-2.nexa) and yet it worked?
Because I had to uninstall the app multiple times, I imported the files using adb push. The URLs of these models had been tested before, but I think it was accidentally modified
Do you suggest I download the files from (https://huggingface.co/NexaAI/OmniNeural-4B-mobile), and go with adb push method as you did? The problem is that in the app you still need to push the "download" otherwise it complains when directly pushing to load.
Yes, you can try it this way first. My colleague has an S25 ultra there. Once he finishes using it, I'll immediately use that phone to test it.
One more question: does this app need a rooted device?
No need for rooted device. My devices are all not rooted
I tried with adb push, and pushed all files to folder /data/data/com.nexa.demo/files/models/OmniNeural-4B. It did not work again and I got the same load issue (Model create() failed). Could be the files uploaded in https://huggingface.co/NexaAI/OmniNeural-4B-mobile are wrong ones or corrupted? Have you been testing with original model files or with downloaded files from HuggingFace? You could try first download from HuggingFace and then adb push the downloaded files. This way we know if the HuggingFace files have no issues.
I re-downloaded from https://huggingface.co/NexaAI/OmniNeural-4B-mobile, and it works.Sorry, I still need more time to reproduce it.
Do I need access token from Nexa or huggingface token to run the model?
No need. The HuggingFace token is used to download the model. Sometimes HuggingFace may prevent the download. Adding a token can solve this problem.
Any new findings/fixations for model creation failure in Samsung S25 Ultra?
Hi @saba-er @nfl-nexa ,I’m seeing a similar issue. (device: Xiaomi Pad 8 Pro)
Following the tutorial at https://github.com/NexaAI/nexa-sdk/tree/main/bindings/android, the model downloads successfully, but when I tap “Load” I get: • License validation failed: validation failed: Unable to write to license file • NexaSdk create() failed, error code: -100601
Also, in the directory /data/user/0/com.nexa.demo/files/models/OmniNeural-4B there is no license file and no nexa.manifest file.
I haven’t changed the demo code; the only change is lowering the Android Gradle Plugin to 8.5.0. Could this be related to the error, or is there any recommended way to debug this? Thanks!
Hi,
Any update on how to resolve the issue?