From 8dd996f73cf9838c82b619f7398db1f24f9891fe Mon Sep 17 00:00:00 2001 From: Jagadeesh J Date: Tue, 20 Dec 2022 13:48:45 +0530 Subject: [PATCH 1/2] fix/Speechrecognition-App Signed-off-by: Jagadeesh J --- SpeechRecognition/app/build.gradle | 10 ++++++++-- SpeechRecognition/app/src/main/AndroidManifest.xml | 3 ++- SpeechRecognition/build.gradle | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/SpeechRecognition/app/build.gradle b/SpeechRecognition/app/build.gradle index 35a7706a..777bdc8d 100644 --- a/SpeechRecognition/app/build.gradle +++ b/SpeechRecognition/app/build.gradle @@ -8,13 +8,13 @@ repositories { } android { - compileSdkVersion 30 + compileSdkVersion 33 buildToolsVersion "30.0.2" defaultConfig { applicationId "org.pytorch.demo.speechrecognition" minSdkVersion 28 - targetSdkVersion 30 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -41,4 +41,10 @@ dependencies { androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' implementation 'org.pytorch:pytorch_android_lite:1.10.0' + + implementation 'com.facebook.fbjni:fbjni-java-only:0.0.3' + + // if using the libraries built from source + // implementation(name:'pytorch_android-release', ext:'aar') + // implementation(name:'pytorch_android_torchvision-release', ext:'aar') } \ No newline at end of file diff --git a/SpeechRecognition/app/src/main/AndroidManifest.xml b/SpeechRecognition/app/src/main/AndroidManifest.xml index c653b1d2..483cb88f 100644 --- a/SpeechRecognition/app/src/main/AndroidManifest.xml +++ b/SpeechRecognition/app/src/main/AndroidManifest.xml @@ -11,7 +11,8 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - + diff --git a/SpeechRecognition/build.gradle b/SpeechRecognition/build.gradle index 6754c23d..aa45fc4c 100644 --- a/SpeechRecognition/build.gradle +++ b/SpeechRecognition/build.gradle @@ -16,6 +16,10 @@ allprojects { repositories { google() jcenter() + mavenCentral() + flatDir { + dirs 'libs' + } } } From 408127ff8ccaf8b65c5eb7f3af4342655b777975 Mon Sep 17 00:00:00 2001 From: Jagadeesh J Date: Mon, 30 Jan 2023 08:13:32 +0530 Subject: [PATCH 2/2] change pt version Signed-off-by: Jagadeesh J --- SpeechRecognition/README.md | 10 +++++----- SpeechRecognition/app/build.gradle | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SpeechRecognition/README.md b/SpeechRecognition/README.md index f7e36451..d7b2ff01 100644 --- a/SpeechRecognition/README.md +++ b/SpeechRecognition/README.md @@ -8,9 +8,9 @@ In this demo app, we'll show how to quantize, trace, and optimize the wav2vec2 m ## Prerequisites -* PyTorch 1.10.0 and torchaudio 0.10.0 (Optional) +* PyTorch 1.13.0 and torchaudio 0.14.0 (Optional) * Python 3.8 (Optional) -* Android Pytorch library org.pytorch:pytorch_android_lite:1.10.0 +* Android Pytorch library org.pytorch:pytorch_android_lite:1.13.0 * Android Studio 4.0.1 or later ## Quick Start @@ -24,11 +24,11 @@ git clone https://github.com/pytorch/android-demo-app cd android-demo-app/SpeechRecognition ``` -If you don't have PyTorch 1.10.0 and torchaudio 0.10.0 installed or want to have a quick try of the demo app, you can download the quantized scripted wav2vec2 model file [here](https://drive.google.com/file/d/1xMh-BZMSIeoohBfZvQFYcemmh5zUn_gh/view?usp=sharing), then drag and drop it to the `app/src/main/assets` folder inside `android-demo-app/SpeechRecognition`, and continue to Step 3. +If you don't have PyTorch 1.13.0 and torchaudio 0.14.0 installed or want to have a quick try of the demo app, you can download the quantized scripted wav2vec2 model file [here](https://drive.google.com/file/d/1xMh-BZMSIeoohBfZvQFYcemmh5zUn_gh/view?usp=sharing), then drag and drop it to the `app/src/main/assets` folder inside `android-demo-app/SpeechRecognition`, and continue to Step 3. ### 2. Prepare the Model -To install PyTorch 1.10.0, torchaudio 0.10.0 and the Hugging Face transformers, you can do something like this: +To install PyTorch 1.13.0, torchaudio 0.14.0 and the Hugging Face transformers, you can do something like this: ``` conda create -n wav2vec2 python=3.8.5 @@ -36,7 +36,7 @@ conda activate wav2vec2 pip install torch torchaudio transformers ``` -Now with PyTorch 1.10.0 and torchaudio 0.10.0 installed, run the following commands on a Terminal: +Now with PyTorch 1.13.0 and torchaudio 0.14.0 installed, run the following commands on a Terminal: ``` python create_wav2vec2.py diff --git a/SpeechRecognition/app/build.gradle b/SpeechRecognition/app/build.gradle index 777bdc8d..a11a8231 100644 --- a/SpeechRecognition/app/build.gradle +++ b/SpeechRecognition/app/build.gradle @@ -40,7 +40,7 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' - implementation 'org.pytorch:pytorch_android_lite:1.10.0' + implementation 'org.pytorch:pytorch_android_lite:1.13.0' implementation 'com.facebook.fbjni:fbjni-java-only:0.0.3'