dlxj commited on
Commit ·
af9c3d5
1
Parent(s): 504d65b
RNNT EOU 成功推理
Browse files
examples/asr/asr_eou/speech_to_text_rnnt_eou_train.py
CHANGED
|
@@ -360,7 +360,7 @@ if __name__ == '__main__':
|
|
| 360 |
'exp_manager.resume_ignore_no_checkpoint=true',
|
| 361 |
'exp_manager.exp_dir=results/',
|
| 362 |
'exp_manager.checkpoint_callback_params.save_top_k=1',
|
| 363 |
-
'++trainer.check_val_every_n_epoch=
|
| 364 |
'++model.encoder.conv_norm_type=layer_norm',
|
| 365 |
'model.tokenizer.dir=data/common_voice_11_0/ja/tokenizers/tokenizer_spe_bpe_v2491_eou',
|
| 366 |
'model.train_ds.tarred_audio_filepaths=data/common_voice_11_0/ja/train_tarred_1bk/audio__OP_0..1023_CL_.tar',
|
|
@@ -371,14 +371,14 @@ if __name__ == '__main__':
|
|
| 371 |
'~model.train_ds.augmentor.noise',
|
| 372 |
'model.validation_ds.manifest_filepath=data/common_voice_11_0/ja/validation_tarred_1bk/tarred_audio_manifest.json',
|
| 373 |
'model.test_ds.manifest_filepath=data/common_voice_11_0/ja/test_tarred_1bk/tarred_audio_manifest.json',
|
| 374 |
-
'trainer.max_epochs=
|
| 375 |
'trainer.devices=1',
|
| 376 |
'trainer.accelerator=gpu',
|
| 377 |
'trainer.strategy=auto',
|
| 378 |
'trainer.log_every_n_steps=1',
|
| 379 |
-
'model.train_ds.batch_size=
|
| 380 |
-
'model.validation_ds.batch_size=
|
| 381 |
-
'model.test_ds.batch_size=
|
| 382 |
'model.train_ds.num_workers=0',
|
| 383 |
'model.validation_ds.num_workers=0',
|
| 384 |
'model.test_ds.num_workers=0',
|
|
|
|
| 360 |
'exp_manager.resume_ignore_no_checkpoint=true',
|
| 361 |
'exp_manager.exp_dir=results/',
|
| 362 |
'exp_manager.checkpoint_callback_params.save_top_k=1',
|
| 363 |
+
'++trainer.check_val_every_n_epoch=1',
|
| 364 |
'++model.encoder.conv_norm_type=layer_norm',
|
| 365 |
'model.tokenizer.dir=data/common_voice_11_0/ja/tokenizers/tokenizer_spe_bpe_v2491_eou',
|
| 366 |
'model.train_ds.tarred_audio_filepaths=data/common_voice_11_0/ja/train_tarred_1bk/audio__OP_0..1023_CL_.tar',
|
|
|
|
| 371 |
'~model.train_ds.augmentor.noise',
|
| 372 |
'model.validation_ds.manifest_filepath=data/common_voice_11_0/ja/validation_tarred_1bk/tarred_audio_manifest.json',
|
| 373 |
'model.test_ds.manifest_filepath=data/common_voice_11_0/ja/test_tarred_1bk/tarred_audio_manifest.json',
|
| 374 |
+
'trainer.max_epochs=1',
|
| 375 |
'trainer.devices=1',
|
| 376 |
'trainer.accelerator=gpu',
|
| 377 |
'trainer.strategy=auto',
|
| 378 |
'trainer.log_every_n_steps=1',
|
| 379 |
+
'model.train_ds.batch_size=1', # Reduced batch size for transducer/EOU as it consumes more memory
|
| 380 |
+
'model.validation_ds.batch_size=1',
|
| 381 |
+
'model.test_ds.batch_size=1',
|
| 382 |
'model.train_ds.num_workers=0',
|
| 383 |
'model.validation_ds.num_workers=0',
|
| 384 |
'model.test_ds.num_workers=0',
|
readme.txt
CHANGED
|
@@ -291,7 +291,8 @@ TODO:
|
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
-
|
|
|
|
| 295 |
|
| 296 |
|
| 297 |
|
|
|
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
+
训练 RNNT EOU
|
| 295 |
+
python examples/asr/asr_eou/speech_to_text_rnnt_eou_train.py
|
| 296 |
|
| 297 |
|
| 298 |
|
server_aware_streaming.py
CHANGED
|
@@ -28,8 +28,8 @@ def _hash_audio(audio: np.ndarray) -> str:
|
|
| 28 |
|
| 29 |
|
| 30 |
# DEFAULT_MODEL = "./nemotron-speech-streaming-en-0.6b/nemotron-speech-streaming-en-0.6b.nemo"
|
| 31 |
-
DEFAULT_MODEL = "results/NeMo_Ja_FastConformer_Streaming/checkpoints/NeMo_Ja_FastConformer_Streaming.nemo"
|
| 32 |
-
|
| 33 |
|
| 34 |
# Right context options for att_context_size=[70, X]
|
| 35 |
RIGHT_CONTEXT_OPTIONS = {
|
|
|
|
| 28 |
|
| 29 |
|
| 30 |
# DEFAULT_MODEL = "./nemotron-speech-streaming-en-0.6b/nemotron-speech-streaming-en-0.6b.nemo"
|
| 31 |
+
# DEFAULT_MODEL = "results/NeMo_Ja_FastConformer_Streaming/checkpoints/NeMo_Ja_FastConformer_Streaming.nemo"
|
| 32 |
+
DEFAULT_MODEL = "results/NeMo_Ja_FastConformer_Transducer_RNNT_EOU/checkpoints/NeMo_Ja_FastConformer_Transducer_RNNT_EOU.nemo"
|
| 33 |
|
| 34 |
# Right context options for att_context_size=[70, X]
|
| 35 |
RIGHT_CONTEXT_OPTIONS = {
|
test_websocket_client.py
CHANGED
|
@@ -174,7 +174,7 @@ if __name__ == "__main__":
|
|
| 174 |
if "--all" in sys.argv:
|
| 175 |
asyncio.run(test_multiple_chunk_sizes(audio_path, server_url))
|
| 176 |
else:
|
| 177 |
-
chunk_ms =
|
| 178 |
if "--chunk" in sys.argv:
|
| 179 |
idx = sys.argv.index("--chunk")
|
| 180 |
if idx + 1 < len(sys.argv):
|
|
|
|
| 174 |
if "--all" in sys.argv:
|
| 175 |
asyncio.run(test_multiple_chunk_sizes(audio_path, server_url))
|
| 176 |
else:
|
| 177 |
+
chunk_ms = 200
|
| 178 |
if "--chunk" in sys.argv:
|
| 179 |
idx = sys.argv.index("--chunk")
|
| 180 |
if idx + 1 < len(sys.argv):
|