Junr-syl commited on
Commit
db1302b
1 Parent(s): 4f1d5c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -2,6 +2,7 @@ from tempfile import NamedTemporaryFile
2
  from transformers import pipeline
3
  import streamlit as st
4
  from st_audiorec import st_audiorec
 
5
  @st.cache_resource
6
  def load_model():
7
  pipe=pipeline("automatic-speech-recognition","distil-whisper/distil-large-v2")
@@ -16,6 +17,7 @@ def make_text(audio):
16
  return extract_text
17
 
18
  st.title('speech recognition, is it worth it!')
 
19
  col1,col2=st.columns(2)
20
  with col1:
21
  with st.form(key='record audio'):
@@ -24,7 +26,7 @@ with col1:
24
  wave_audio_data=st_audiorec()
25
 
26
  #submit
27
- button=st.form_submit_button(label='Convert to Text')
28
  #if the submit button is pressed
29
  if button:
30
  st.success('audio submitted, processing is slow give us some few seconds')
@@ -48,7 +50,7 @@ with col2:
48
  upload=st.file_uploader(label='Upload audio file')
49
 
50
  #submit
51
- button=st.form_submit_button(label='Convert to Text')
52
  #if the submit button is pressed
53
  if button:
54
  st.success('audio submitted, processing is slow give us some few seconds')
 
2
  from transformers import pipeline
3
  import streamlit as st
4
  from st_audiorec import st_audiorec
5
+ #load and cache speech recoginition model
6
  @st.cache_resource
7
  def load_model():
8
  pipe=pipeline("automatic-speech-recognition","distil-whisper/distil-large-v2")
 
17
  return extract_text
18
 
19
  st.title('speech recognition, is it worth it!')
20
+ st.write('Click start recording to record an audio in English, afterwards click stop, click on convert text once and wait')
21
  col1,col2=st.columns(2)
22
  with col1:
23
  with st.form(key='record audio'):
 
26
  wave_audio_data=st_audiorec()
27
 
28
  #submit
29
+ button=st.form_submit_button(label='Convert to Text,click once and wait')
30
  #if the submit button is pressed
31
  if button:
32
  st.success('audio submitted, processing is slow give us some few seconds')
 
50
  upload=st.file_uploader(label='Upload audio file')
51
 
52
  #submit
53
+ button=st.form_submit_button(label='Convert to Tex. Click once and wait')
54
  #if the submit button is pressed
55
  if button:
56
  st.success('audio submitted, processing is slow give us some few seconds')