Junr-syl commited on
Commit
69a99de
1 Parent(s): e318712

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,9 +1,8 @@
1
  import torch
2
- from torch import *
3
  from transformers import pipeline
4
  import streamlit as st
5
  from st_audiorec import st_audiorec
6
- #@st.cache
7
  def make_text(audio):
8
  pipe=pipeline("automatic-speech-recognition","distil-whisper/distil-large-v2")
9
  text= pipe(audio)
@@ -14,8 +13,8 @@ st.title('speech recognition')
14
  wave_audio_data=st_audiorec()
15
  if wave_audio_data is not None:
16
 
17
- audio_input=st.audio(wave_audio_data,format="audio/wave")
18
- text=make_text(audio_input)
19
 
20
  st.write(text)
21
  else:
 
1
  import torch
 
2
  from transformers import pipeline
3
  import streamlit as st
4
  from st_audiorec import st_audiorec
5
+ @st.cache
6
  def make_text(audio):
7
  pipe=pipeline("automatic-speech-recognition","distil-whisper/distil-large-v2")
8
  text= pipe(audio)
 
13
  wave_audio_data=st_audiorec()
14
  if wave_audio_data is not None:
15
 
16
+
17
+ text=make_text(wave_audio_data)
18
 
19
  st.write(text)
20
  else: