-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run inference on NNAPI or GPU #12
Comments
Logcat when the interpreter is loaded thus: try {
Vocab vocab = ExtractVocab.extractVocab(getAssets().open("filters_vocab_gen.bin"));
HashMap<String, String> phraseMappings = new HashMap<>();
_dictionary = new Dictionary(vocab, phraseMappings);
MappedByteBuffer model = loadWhisperModel(getAssets());
Interpreter.Options options = new Interpreter.Options();
options.setUseNNAPI(true);
NnApiDelegate.Options nnApiOptions = new NnApiDelegate.Options();
NnApiDelegate nnApiDelegate = new NnApiDelegate(nnApiOptions);
options.addDelegate(nnApiDelegate);
_whisperInterpreter = new Interpreter(model, options);
} catch (IOException e) {
e.printStackTrace();
}
|
It appears that the NNDelegate code has crashed, and my suspicion is that it is using the xnn pack delegate by default. To use the NNDelegate, certain flags may need to be enabled during the building of the tflite library. If you wish to run a model other than the English one, you will need to load the "filters_vocab_multilingual.bin" file from this GitHub repository: https://github.com/usefulsensors/openai-whisper/blob/main/models/filters_vocab_multilingual.bin. Please try running the model with this file loaded. |
to just confirm if nnapi delegate is working or not with tflite model. |
This tflite model appears to work.
Bookmarked, thank you. |
|
Are you able to tell me what factors contribute to it being compatible? |
The whisper hybrid tflite model may not be compatible due to its mixed precision format, where weights are in int8 and activations are in float32. It's possible that generating a full float model could resolve this issue. Additionally, other causes of incompatibility could be related to unsupported ops, meaning that certain operations included in the model are not supported by the NNDelegate's available ops |
Any success with running it on gpu |
No description provided.
The text was updated successfully, but these errors were encountered: