MinuteBotSpaces / app.py
jonnatakusuma's picture
v2
aadb24e
raw
history blame contribute delete
800 Bytes
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)