File tree Expand file tree Collapse file tree
whisper/android/WhisperApp
app/src/main/java/com/example/whisperapp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Checkout [Whisper JNI Bindings](https://github.com/pytorch/executorch/pull/13525
1111There are two steps, audio processing and the Whisper model (encoder+decoder), which are both done via ExecuTorch.
1212
13131 ) Run the script ` extension/audio/mel_spectrogram.py ` to export ` whisper_preprocess.pte `
14- 2 ) Run the scrint ` examples/qualcomm/oss_scripts/whisper/whisper.py ` to export ` whisper_qnn_16a8w.pte `
14+ 2 ) Run the script ` examples/qualcomm/oss_scripts/whisper/whisper.py ` to export ` whisper_qnn_16a8w.pte `
1515
1616Move these two .pte files along with ` tokenizer.json ` to ` /data/local/tmp/whisper ` on device.
1717
@@ -22,4 +22,3 @@ Open WhisperApp in Android studio. Copy the Android library `executorch.aar` whi
2222
2323
2424https://github.com/user-attachments/assets/ff8c71c5-b734-4ed4-8382-70a429830665
25-
Original file line number Diff line number Diff line change @@ -20,14 +20,14 @@ import androidx.core.content.ContextCompat
2020import org.pytorch.executorch.EValue
2121import org.pytorch.executorch.Module
2222import org.pytorch.executorch.Tensor
23- import org.pytorch.executorch.extension.audio.WhisperCallback
24- import org.pytorch.executorch.extension.audio.WhisperModule
23+ import org.pytorch.executorch.extension.audio.ASRCallback
24+ import org.pytorch.executorch.extension.audio.ASRModule
2525import java.io.*
2626import java.nio.ByteBuffer
2727import java.nio.ByteOrder
2828
2929
30- class MainActivity : ComponentActivity (), WhisperCallback {
30+ class MainActivity : ComponentActivity (), ASRCallback {
3131
3232 companion object {
3333 private const val TAG = " MainActivity"
@@ -147,7 +147,7 @@ class MainActivity : ComponentActivity(), WhisperCallback {
147147 result.forEach { byteBuffer.putFloat(it) }
148148 val byteArray = arrayOf(byteBuffer.array())
149149
150- val whisperModule = WhisperModule (" /data/local/tmp/whisper/whisper_qnn_16a8w.pte" ,
150+ val whisperModule = ASRModule (" /data/local/tmp/whisper/whisper_qnn_16a8w.pte" ,
151151 " /data/local/tmp/whisper/tokenizer.json" )
152152
153153 Log .v(TAG , " Starting transcribe" )
You can’t perform that action at this time.
0 commit comments