Junr-syl commited on
Commit
a108eba
1 Parent(s): e3118d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1,4 +1,4 @@
1
-
2
  from transformers import pipeline
3
  import streamlit as st
4
  from st_audiorec import st_audiorec
@@ -51,9 +51,12 @@ with col2:
51
  #if the submit button is pressed
52
  if button:
53
  if upload is not None:
54
- text=make_text(upload)
55
-
56
- st.write(text)
 
 
 
57
 
58
  else:
59
  st.success('No Audio data yet')
 
1
+ from tempfile import NamedTemporaryFile
2
  from transformers import pipeline
3
  import streamlit as st
4
  from st_audiorec import st_audiorec
 
51
  #if the submit button is pressed
52
  if button:
53
  if upload is not None:
54
+ with NamedTemporaryFile() as temp:
55
+ temp.write(upload.getvalue())
56
+ temp.seek(0)
57
+ text = make_text(temp.name)
58
+
59
+ st.write(text)
60
 
61
  else:
62
  st.success('No Audio data yet')