|
import gradio as gr |
|
from transformers import pipeline |
|
|
|
p = pipeline("automatic-speech-recognition", model="DewiBrynJones/wav2vec2-xlsr-53-ft-ccv-en-cy", decoder = "Wav2Vec2ProcessorWithLM") |
|
|
|
def transcribe(audio): |
|
text = p(audio)["text"] |
|
return text |
|
|
|
demo = gr.Interface( |
|
fn=transcribe, |
|
title="Adnabod Lleferydd Cymraeg a Saesneg // Welsh and English Automatic Speech Recognition", |
|
description="Recordiwch eich hunain gyda'ch meicroffon yn dweud rhywbeth yn Gymraeg neu Saesneg ac fe ddangosir yr AI drawsgrifiad o beth dywedoch. // Record yourself with your microphone saying something in Welsh or English and the AI will show you a transcript of what you said. ", |
|
inputs=gr.Audio(sources=["microphone"], type="filepath"), |
|
outputs=gr.Textbox(label="Trawsgrifiad // Transcription") |
|
) |
|
|
|
demo.launch() |
|
|