Skip to content

Commit 4b55fae

Browse files
authored
Change API Whisper -> ASR (#60)
1 parent 351b1d6 commit 4b55fae

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

whisper/android/WhisperApp/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Checkout [Whisper JNI Bindings](https://github.com/pytorch/executorch/pull/13525
1111
There are two steps, audio processing and the Whisper model (encoder+decoder), which are both done via ExecuTorch.
1212

1313
1) 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

1616
Move 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

2424
https://github.com/user-attachments/assets/ff8c71c5-b734-4ed4-8382-70a429830665
25-

whisper/android/WhisperApp/app/src/main/java/com/example/whisperapp/MainActivity.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ import androidx.core.content.ContextCompat
2020
import org.pytorch.executorch.EValue
2121
import org.pytorch.executorch.Module
2222
import 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
2525
import java.io.*
2626
import java.nio.ByteBuffer
2727
import 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")

0 commit comments

Comments
 (0)