Update app.py
Browse files
app.py
CHANGED
@@ -6,13 +6,13 @@ import numpy as np
|
|
6 |
|
7 |
import streamlit as st
|
8 |
from audio2text.a2t import A2T
|
9 |
-
from
|
10 |
|
11 |
-
audio =
|
12 |
|
13 |
def main():
|
14 |
-
if
|
15 |
-
|
16 |
if st.button("Get text"):
|
17 |
with st.spinner("Wait for it...."):
|
18 |
a2t = A2T(audio)
|
@@ -21,11 +21,9 @@ def main():
|
|
21 |
st.write(text)
|
22 |
st.success("Done")
|
23 |
else:
|
24 |
-
print("error")
|
25 |
|
26 |
if __name__ == "__main__":
|
27 |
-
# Getting % usage of virtual_memory ( 3rd field)
|
28 |
print('RAM memory % used:', psutil.virtual_memory()[2])
|
29 |
-
# Getting usage of virtual_memory in GB ( 4th field)
|
30 |
print('RAM Used (GB):', psutil.virtual_memory()[3]/1000000000)
|
31 |
main()
|
|
|
6 |
|
7 |
import streamlit as st
|
8 |
from audio2text.a2t import A2T
|
9 |
+
from st_audiorec import st_audiorec
|
10 |
|
11 |
+
audio = st_audiorec
|
12 |
|
13 |
def main():
|
14 |
+
if audio is not None:
|
15 |
+
print(type(audio))
|
16 |
if st.button("Get text"):
|
17 |
with st.spinner("Wait for it...."):
|
18 |
a2t = A2T(audio)
|
|
|
21 |
st.write(text)
|
22 |
st.success("Done")
|
23 |
else:
|
24 |
+
print("error audio is None")
|
25 |
|
26 |
if __name__ == "__main__":
|
|
|
27 |
print('RAM memory % used:', psutil.virtual_memory()[2])
|
|
|
28 |
print('RAM Used (GB):', psutil.virtual_memory()[3]/1000000000)
|
29 |
main()
|