import streamlit as st import whisper from tempfile import NamedTemporaryFile import ffmpeg st.title("Whisper App") # upload audio file with streamlit audio_file = st.file_uploader("Upload Meeting Audio", type=["mp3"]) # model = whisper.load_model("base") # loading the base model st.text("Whisper Model Loaded") def load_whisper_model(): return model if st.sidebar.button("Transcribe Audio"): if audio_file is not None: with NamedTemporaryFile(suffix="mp3") as temp: temp.write(audio_file.getvalue()) temp.seek(0) model = whisper.load_model("base") result = model.transcribe(temp.name) st.write(result["text"]) # st.sidebar.success("Transcribing Audio") # transcription = model.transcribe(audio_file.name) # st.sidebar.success("Transcription Complete") # st.markdown(transcription["text"]) # else: # st.sidebar.error("Please upload an audio file") st.sidebar.header("Play Original Audio File") st.sidebar.audio(audio_file)