Skip to content

Commit d2c41cb

Browse files
authored
[android] update units for android (#1222)
1 parent 1756db3 commit d2c41cb

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

runtime/device/android/wenet/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Or you can train your own model using WeNet training pipeline on your data.
2424

2525
### 2) Build APK
2626

27-
When your model is ready, put `final.zip` and `words.txt` into Android assets (`app/src/main/assets`) folder,
27+
When your model is ready, put `final.zip` and `units.txt` into Android assets (`app/src/main/assets`) folder,
2828
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.
2929
Please note the wifi and data has been disabled in the demo so there is no network connection ^\_^.
3030

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
put final.zip and words.txt here.
1+
put final.zip and units.txt here.

runtime/device/android/wenet/app/src/main/cpp/wenet.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void init(JNIEnv* env, jobject, jstring jModelDir) {
3838
const char* pModelDir = env->GetStringUTFChars(jModelDir, nullptr);
3939

4040
std::string modelPath = std::string(pModelDir) + "/final.zip";
41-
std::string dictPath = std::string(pModelDir) + "/words.txt";
41+
std::string dictPath = std::string(pModelDir) + "/units.txt";
4242
auto model = std::make_shared<TorchAsrModel>();
4343
model->Read(modelPath);
4444
LOG(INFO) << "model path: " << modelPath;

runtime/device/android/wenet/app/src/main/java/com/mobvoi/wenet/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class MainActivity extends AppCompatActivity {
3333
private static final int SAMPLE_RATE = 16000; // The sampling rate
3434
private static final int MAX_QUEUE_SIZE = 2500; // 100 seconds audio, 1 / 0.04 * 100
3535
private static final List<String> resource = Arrays.asList(
36-
"final.zip", "words.txt", "ctc.ort", "decoder.ort", "encoder.ort"
36+
"final.zip", "units.txt", "ctc.ort", "decoder.ort", "encoder.ort"
3737
);
3838

3939
private boolean startRecord = false;

0 commit comments

Comments
 (0)