Views
No views yet
valid.loss.best.pth) and configuration file (config.yaml):1import soundfile as sf
2from espnet2.bin.asr_inference import Speech2Text
3
4asr_train_config = "ctc-dro_mms_set_2/config.yaml"
5asr_model_file = "ctc-dro_mms_set_2/valid.loss.best.pth"
6
7model = Speech2Text.from_pretrained(
8 asr_train_config=asr_train_config,
9 asr_model_file=asr_model_file
10)
11
12speech, _ = sf.read("input.wav")
13text, *_ = model(speech)[0]
14
15print("Recognized text:", text)config.yaml and checkpoint file.config.yaml are available at the indicated relative paths.