File size: 498 Bytes
835ac33
 
 
 
24d98ad
bf5d300
 
 
 
 
835ac33
 
 
bf5d300
835ac33
69a99de
 
835ac33
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import torch
from transformers import pipeline
import streamlit as st
from st_audiorec import st_audiorec 
@st.cache_resource
def make_text(audio):
    pipe=pipeline("automatic-speech-recognition","distil-whisper/distil-large-v2")
    text= pipe(audio)
    extract_text=text['text']
    return extract_text

st.title('speech recognition')
wave_audio_data=st_audiorec()
if wave_audio_data is not None:

    
    text=make_text(wave_audio_data)

    st.write(text)
else:
    st.error('No Audio data')