File size: 442 Bytes
835ac33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import torch
from torch import *
from transformers import pipeline
import streamlit as st
from st_audiorec import st_audiorec 

pipe=pipeline("automatic-speech-recognition","distil-whisper/distil-large-v2")

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

    audio_input=st.audio(wave_audio_data,format="audio/wave")

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