# -*- coding: utf-8 -*- """whisper_audio_file.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1Drv49mO5QDOUMBpoWeRW6RrxGHLe0b2o # Using gradio for making a nice UI. Upload audio file version. Installing requirements. """ !pip install gradio !pip install git+https://github.com/huggingface/transformers from transformers import pipeline import gradio as gr import os """## Building a Demo""" pipe = pipeline(model="Victorlopo21/whisper-medium-gl-30") #pipe = pipeline(model="marvmk/whisper-small-gl") # change to "your-username/the-name-you-picked" def transcribe(audio): text = pipe(audio, chunk_length=10)['text'] return text iface = gr.Interface( fn=transcribe, inputs=gr.Audio(type="filepath"), outputs="text", title="Whisper Small Galician", description="Realtime demo for Galician speech recognition using a fine-tuned Whisper small model.", ) iface.launch(debug=True) # TO TRY