Views
No views yet
1import torch
2import numpy as np
3from espnet2.bin.s2t_inference import Speech2Text
4
5# Load the model
6model = Speech2Text.from_pretrained(
7 "reecursion/accent-adaptive-owsm_v3.1_ebf_base",
8 lang_sym="<eng>",
9 beam_size=1,
10 device="cuda" if torch.cuda.is_available() else "cpu"
11)
12
13# Example inference
14waveform = ... # Load your audio as numpy array
15transcription = model(waveform)
16print(transcription[0][0]) # Print the transcription