import streamlit as st import whisper # Function to transcribe uploaded audio file def transcribe_audio(uploaded_file): model = whisper.load_model("base") transcription = model.transcribe(uploaded_file) return transcription['text'] # Streamlit App Interface st.title("Speech-to-Text Transcription") st.write("Upload an audio file to get the transcription.") # Upload audio file uploaded_file = st.file_uploader("Upload an audio file", type=["wav", "mp3", "ogg"]) if uploaded_file is not None: st.write("Transcribing audio...") transcription = transcribe_audio(uploaded_file) st.write("Transcription:") st.write(transcription)