Junr-syl commited on
Commit
8b70fcd
1 Parent(s): 489e5a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -1,4 +1,3 @@
1
- import torch
2
  from transformers import pipeline
3
  import streamlit as st
4
  from st_audiorec import st_audiorec
@@ -16,12 +15,13 @@ def make_text(audio):
16
  return extract_text
17
 
18
  st.title('speech recognition')
19
- wave_audio_data=st_audiorec()
20
- if wave_audio_data is not None:
 
 
21
 
22
-
23
- text=make_text(wave_audio_data)
24
 
25
- st.write(text)
26
- else:
27
- st.error('No Audio data')
 
 
1
  from transformers import pipeline
2
  import streamlit as st
3
  from st_audiorec import st_audiorec
 
15
  return extract_text
16
 
17
  st.title('speech recognition')
18
+ with st.form(key='record audio'):
19
+ wave_audio_data=st_audiorec()
20
+ button=st.form_submit_button(label='Convert to Text')
21
+ if button:
22
 
23
+ text=make_text(wave_audio_data)
 
24
 
25
+ st.write(text)
26
+ else:
27
+ st.success('No Audio data yet')