Skip to content

Commit

Permalink
[android] update units for android (#1222)
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhendong authored Jun 12, 2022
1 parent 1756db3 commit d2c41cb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion runtime/device/android/wenet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Or you can train your own model using WeNet training pipeline on your data.

### 2) Build APK

When your model is ready, put `final.zip` and `words.txt` into Android assets (`app/src/main/assets`) folder,
When your model is ready, put `final.zip` and `units.txt` into Android assets (`app/src/main/assets`) folder,
then just build and run the APK. Here is a gif demo, which shows how our on-device streaming e2e ASR runs with low latency.
Please note the wifi and data has been disabled in the demo so there is no network connection ^\_^.

Expand Down
2 changes: 1 addition & 1 deletion runtime/device/android/wenet/app/src/main/assets/README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
put final.zip and words.txt here.
put final.zip and units.txt here.
2 changes: 1 addition & 1 deletion runtime/device/android/wenet/app/src/main/cpp/wenet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void init(JNIEnv* env, jobject, jstring jModelDir) {
const char* pModelDir = env->GetStringUTFChars(jModelDir, nullptr);

std::string modelPath = std::string(pModelDir) + "/final.zip";
std::string dictPath = std::string(pModelDir) + "/words.txt";
std::string dictPath = std::string(pModelDir) + "/units.txt";
auto model = std::make_shared<TorchAsrModel>();
model->Read(modelPath);
LOG(INFO) << "model path: " << modelPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class MainActivity extends AppCompatActivity {
private static final int SAMPLE_RATE = 16000; // The sampling rate
private static final int MAX_QUEUE_SIZE = 2500; // 100 seconds audio, 1 / 0.04 * 100
private static final List<String> resource = Arrays.asList(
"final.zip", "words.txt", "ctc.ort", "decoder.ort", "encoder.ort"
"final.zip", "units.txt", "ctc.ort", "decoder.ort", "encoder.ort"
);

private boolean startRecord = false;
Expand Down

0 comments on commit d2c41cb

Please sign in to comment.