Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,8 @@ jobs:
path: mv3/android/MV3Demo
- name: YoloDemo
path: Yolo/android
- name: WhisperDemo
path: whisper/android/WhisperApp
require_aar: true
- name: ParakeetDemo
path: parakeet/android/ParakeetApp
- name: AsrDemo
path: asr/android/AsrApp
require_aar: true


Expand All @@ -62,7 +59,7 @@ jobs:
uses: gradle/actions/setup-gradle@v4

- name: Download local AAR
if: ${{ inputs.local_aar && (matrix.name == 'LlamaDemo' || matrix.name == 'YoloDemo' || matrix.name == 'WhisperDemo' || matrix.name == 'ParakeetDemo') }}
if: ${{ inputs.local_aar && (matrix.name == 'LlamaDemo' || matrix.name == 'YoloDemo' || matrix.name == 'AsrDemo') }}
run: |
mkdir -p ${{ matrix.path }}/app/libs
curl -fL -o ${{ matrix.path }}/app/libs/executorch.aar "${{ inputs.local_aar }}"
Expand All @@ -71,7 +68,7 @@ jobs:
if: ${{ !matrix.require_aar || inputs.local_aar }}
working-directory: ${{ matrix.path }}
run: |
if [ -n "${{ inputs.local_aar }}" ] && ([ "${{ matrix.name }}" == "LlamaDemo" ] || [ "${{ matrix.name }}" == "YoloDemo" ] || [ "${{ matrix.name }}" == "WhisperDemo" ] || [ "${{ matrix.name }}" == "ParakeetDemo" ]); then
if [ -n "${{ inputs.local_aar }}" ] && ([ "${{ matrix.name }}" == "LlamaDemo" ] || [ "${{ matrix.name }}" == "YoloDemo" ] || [ "${{ matrix.name }}" == "AsrDemo" ]); then
./gradlew build --no-daemon -PuseLocalAar=true
else
./gradlew build --no-daemon
Expand Down
File renamed without changes.
37 changes: 37 additions & 0 deletions asr/android/AsrApp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ASR Demo App

This app demonstrates running speech recognition models on Android using ExecuTorch. It supports both **Whisper** and **Parakeet** model families.

## Supported Models

| Model | Type | Details |
|-------|------|---------|
| Whisper Tiny/Small/Medium (INT8/INT4) | Streaming | Requires model, tokenizer, and preprocessor |
| Whisper Tiny/Small/Medium (FP32) | Streaming | Requires model, tokenizer, and preprocessor |
| Parakeet TDT 0.6B (INT4) | Synchronous | Requires model and tokenizer |

## Export Model Files

- **Whisper**: Follow the instructions at https://github.com/pytorch/executorch/tree/main/examples/models/whisper
- **Parakeet**: Follow the instructions at https://github.com/pytorch/executorch/tree/main/examples/models/parakeet

## Run the App

1. Open AsrApp in Android Studio
2. Copy the `executorch.aar` library (with ASR and Parakeet JNI bindings) into `app/libs/`
3. Build and run on device

## Download Models

The app includes a built-in download screen to fetch models from HuggingFace. Alternatively, push files manually:

```bash
adb push model.pte /data/local/tmp/asr/
adb push tokenizer.json /data/local/tmp/asr/
adb push whisper_preprocessor.pte /data/local/tmp/asr/ # Whisper only
```

## Recording Behavior

- **Whisper**: Click to start recording; automatically stops after 30 seconds
- **Parakeet**: Click to start recording; click again to stop (no time limit)
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins {
val useLocalAar: Boolean? = (project.findProperty("useLocalAar") as? String)?.toBoolean()

android {
namespace = "com.example.whisperapp"
namespace = "com.example.asrapp"
compileSdk = 35

defaultConfig {
applicationId = "com.example.whisperapp"
applicationId = "com.example.asrapp"
minSdk = 24
targetSdk = 35
versionCode = 1
Expand Down Expand Up @@ -56,4 +56,4 @@ dependencies {
implementation("org.pytorch:executorch-android:1.1.0")
}
implementation("com.facebook.fbjni:fbjni:0.5.1")
}
}
Loading
Loading