sw005320 commited on
Commit
2e27c99
·
verified ·
1 Parent(s): e10985c

Add a usage example to the model card

Browse files
Files changed (1) hide show
  1. README.md +16 -0
README.md CHANGED
@@ -13,6 +13,22 @@ library_name: espnet
13
  pipeline_tag: automatic-speech-recognition
14
  ---
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  🏆 **News:** Our [OWSM v4 paper](https://www.isca-archive.org/interspeech_2025/peng25c_interspeech.html) won the [Best Student Paper Award](https://isca-speech.org/ISCA-Awards) at INTERSPEECH 2025!
17
 
18
 
 
13
  pipeline_tag: automatic-speech-recognition
14
  ---
15
 
16
+ ## Usage
17
+
18
+ ```python
19
+ import librosa
20
+ from espnet2.bin.s2t_inference import Speech2Text
21
+
22
+ s2t = Speech2Text.from_pretrained(
23
+ model_tag="espnet/owsm_v4_medium_1B", lang_sym="<eng>", task_sym="<asr>", beam_size=5
24
+ )
25
+ # OWSM is trained on 16 kHz; each call decodes 30 s, padded or trimmed
26
+ speech, rate = librosa.load("audio.wav", sr=16000, mono=True)
27
+ text, token, token_int, text_nospecial, hyp = s2t(speech)[0]
28
+ print(text_nospecial) # `text` keeps OWSM's own <eng><asr> markers
29
+ # for a recording longer than 30 s: s2t.decode_long(speech) -> (start, end, text)
30
+ ```
31
+
32
  🏆 **News:** Our [OWSM v4 paper](https://www.isca-archive.org/interspeech_2025/peng25c_interspeech.html) won the [Best Student Paper Award](https://isca-speech.org/ISCA-Awards) at INTERSPEECH 2025!
33
 
34