File size: 772 Bytes
cab263c
 
1581bbf
cab263c
4affef3
 
 
cab263c
b33a918
4affef3
42b403c
0f6bca4
 
b33a918
a4be465
9bb15cf
 
 
 
a001cc5
 
9bb15cf
c131626
9bb15cf
b33a918
4affef3
 
1581bbf
 
4affef3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# version - ArticMonkey:19.03.24:1743

import psutil

import numpy as np

import streamlit as st 
from audio2text.a2t import A2T
from st_audiorec import st_audiorec

def main():
    audio = st_audiorec()
    
    if audio is not None:
        print(type(audio))
        if st.button("Get text"):
            with st.spinner("Wait for it...."):
                a2t = A2T(audio)
                text = a2t.predict()
                print("Text output in main : ", text)
                st.write(text)
            st.success("Done")
            del audio
        else:
            print("error audio is None")

if __name__ == "__main__":
    print('RAM memory % used:', psutil.virtual_memory()[2])
    print('RAM Used (GB):', psutil.virtual_memory()[3]/1000000000)
    main()