Spaces:
Runtime error
Runtime error
Download app.py from Manickz/ABSTRACTAI: direct link, hf CLI and curl.
- Browser
- Download file 851 Bytes
-
https://huggingface.co/spaces/Manickz/ABSTRACTAI/resolve/main/app.py
- Command line
-
hf download hf://spaces/Manickz/ABSTRACTAI/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Manickz/ABSTRACTAI/resolve/main/app.py
851 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| # Load the Whisper-large-v3 model from Hugging Face on CPU | |
| transcriber = pipeline( | |
| "automatic-speech-recognition", | |
| model="openai/whisper-large-v3", | |
| device=-1 # Ensures the model runs on the CPU | |
| ) | |
| def transcribe_audio(file_path): | |
| # Transcribe the audio file from the given file path | |
| transcription = transcriber(file_path)["text"] | |
| return transcription | |
| # Gradio interface setup with file path input | |
| iface = gr.Interface( | |
| fn=transcribe_audio, | |
| inputs=gr.Textbox(label="Enter the file path of the audio", placeholder="e.g., /path/to/audio.wav"), | |
| outputs="text", | |
| title="Whisper Large v3 ASR", | |
| description="Transcribe audio files using OpenAI's Whisper Large v3 model. Provide the file path of the audio file.", | |
| ) | |
| # Launch the app | |
| iface.launch(share=True) | |