-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Mobile] whisper android sample #18521
Comments
Can you clarify are you following the cloud one or the local example? Infer from the error message and the code snippet you provided, seems like you were following the local one. so in the local example, here we are using the input_name "audio_pcm" based on this whipser_cpu_int8_model.onnx From your error message, your model is expecting these sets of input names: which is probably different from the input names that the example model have. You might want to adjust the input tensor name accordingly. |
Sorry for the confusion, I meant to say local example. Do you mean that I should change audio_pcm to audio_stream ? when I try that I get this error : |
Either input_names/output names, input/output data types, they all have to match with the onnx model you are testing with. The original example is using a model that has input data type of float tensor and I am guessing your model is expecting an uint8 type tensor. Could you please check with Netron that what inputs/outputs your model have? |
[Yes] you are right it takes tensor: uint8[1,?] as input and output an str: tensor: string[N,text], then it uses an AudioDecoder to ouput floatPCM Is the solution to add the option --no_audio_decoder when generating the model, or is there a way i can change my code to adapt to the model ? |
After doing that, I don't get that error anymore, but the thing is I am trying to use --multilingual option which requires decoder_inputs_id that i am not adding, I get this error :
` I am supposed to do somthing that should look like this in python : model = "openai/whisper-tiny" English transcription """If you don't want to provide specific decoder input ids or you want decoder input ids""" but how do I go about it in kotlin is there some documentation about it ? Thank you |
to construct an int32 tensor input in Kotlin, you can refer to this example: I'm not sure if there's a |
Describe the issue
i get this error when i run a model i optimized with onnxruntime, for example openai/whisper-base, i use it then in the example cloud example of whisper, i only change the model.onnx but keep the same audio.pcm ;
Error: Unknown input name audio_pcm, expected one of [audio_stream, max_length, min_length, num_beams, num_return_sequences, length_penalty, repetition_penalty]
'Error: Unknown input name audio_pcm, expected one of [audio_stream, max_length, min_length, num_beams, num_return_sequences, length_penalty, repetition_penalty] ai.onnxruntime.OrtException: Unknown input name audio_pcm, expected one of [audio_stream, max_length, min_length, num_beams, num_return_sequences, length_penalty, repetition_penalty] at ai.onnxruntime.OrtSession.run(OrtSession.java:284) at ai.onnxruntime.OrtSession.run(OrtSession.java:242) at ai.onnxruntime.OrtSession.run(OrtSession.java:210) at com.alex.newnotes.utils.SpeechRecognizer.run(SpeechRecognizer.kt:40) at com.alex.newnotes.utils.AudioTensorSource$Companion.fromRecording(AudioTensorSource.kt:118) at com.alex.newnotes.ui.edit.EditFragment.addSpeech$lambda-28(EditFragment.kt:454) at com.alex.newnotes.ui.edit.EditFragment.$r8$lambda$imHSLHbY2ngBNrJv8EgIh9aj6Dg(Unknown Source:0) at com.alex.newnotes.ui.edit.EditFragment$$ExternalSyntheticLambda11.run(Unknown Source:2) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) '
speechRecognizer.kt : `class SpeechRecognizer(modelBytes: ByteArray) : AutoCloseable {
private val session: OrtSession
private val baseInputs: Map<String, OnnxTensor>
}`
To reproduce
it is basically the same as the example
Urgency
urgent
Platform
Android
OS Version
11.0
ONNX Runtime Installation
Built from Source
Compiler Version (if 'Built from Source')
Package Name (if 'Released Package')
None
ONNX Runtime Version or Commit ID
ONNX Runtime API
Java/Kotlin
Architecture
X86
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: