Spaces:
Running
Running
| import streamlit as st | |
| from transformers import pipeline | |
| st.title("Speech to Text") | |
| transcriber = pipeline(model="openai/whisper-medium") | |
| # audio_file = st.file_uploader("Upload an audio file") | |
| audio_file = "https://huggingface.co/datasets/Narsil/asr_dummy/resolve/main/mlk.flac" | |
| if audio_file: | |
| # to flac | |
| text = transcriber(audio_file) | |
| if text: | |
| st.write("Here is the text:") | |
| st.write(text) | |
| else: | |
| st.write("Processing or No text found in the audio file") | |
| else: | |
| st.write("waiting for file") | |