| |
| """app.ipynb |
| |
| Automatically generated by Colab. |
| |
| Original file is located at |
| https://colab.research.google.com/drive/1hjrg_bSp-xL_7P4IPkBVSDuTqeqsTZKY |
| """ |
|
|
| |
|
|
| import gradio as gr |
| from transformers import pipeline |
|
|
| |
| whisper_model = pipeline("automatic-speech-recognition", model="openai/whisper-small") |
|
|
| def transcribe_audio(audio_file): |
| |
| transcription = whisper_model(audio_file)["text"] |
| return transcription |
|
|
| |
| iface = gr.Interface( |
| fn=transcribe_audio, |
| inputs=gr.Audio(type="filepath"), |
| outputs="text", |
| title="Whisper AI Small Model - Speech to Text", |
| description="Upload or record audio to get the transcription.", |
| ) |
|
|
| |
| iface.launch() |
|
|
|
|
|
|
|
|