File size: 800 Bytes
da1cda6
 
 
 
a105247
 
da1cda6
a105247
da1cda6
 
a105247
da1cda6
 
a105247
da1cda6
a105247
da1cda6
a105247
 
da1cda6
 
 
 
 
aadb24e
da1cda6
 
d73b234
da1cda6
 
d73b234
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
31
32
import streamlit as st
import whisper
from tempfile import NamedTemporaryFile
import ffmpeg


st.title("MinuteBot App")

# upload audio file with streamlit
audio_file = st.file_uploader("Unggah Meeting Audio", type=["mp3", "wav", "m4a"])

# model = whisper.load_model("base") # loading the base model
st.text("MinuteBot Model telah dimuat:")

def load_whisper_model():

    return model

    
if st.sidebar.button("Transkripsikan Audio"):
    if audio_file is not None:
        with NamedTemporaryFile() as temp:
            temp.write(audio_file.getvalue())
            temp.seek(0)
            model = whisper.load_model("large-v2")
            result = model.transcribe(temp.name)
            st.write(result["text"])
        
st.sidebar.header("Putar Berkas Audio")
st.sidebar.audio(audio_file)