Lab2File / app.py
Victorlopo21's picture
Rename whisper_audio_file.py to app.py
d3a26c3
# -*- 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.
"""
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)['text']
return text
iface = gr.Interface(
fn=transcribe,
inputs=gr.Audio(type="filepath"),
outputs="text",
title="Whisper File Audio Medium Galician",
description="Realtime demo for Galician speech recognition with an audio file using a fine-tuned Whisper small model.",
)
iface.launch(debug=True)
# TO TRY