DewiBrynJones commited on
Commit
62af362
1 Parent(s): 82cf04e

fersiwn cyntaf

Browse files
Files changed (2) hide show
  1. app.py +16 -0
  2. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ p = pipeline("automatic-speech-recognition", model="techiaith/wav2vec2-xlsr-ft-cy", decoder = "Wav2Vec2ProcessorWithLM")
5
+
6
+ def transcribe(audio):
7
+ text = p(audio)["text"]
8
+ return text
9
+
10
+ demo = gr.Interface(
11
+ fn=transcribe,
12
+ gr.Audio(sources=["microphone"], type="filepath"),
13
+ "text",
14
+ )
15
+
16
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ transformers
2
+ pyctcdecode
3
+ gradio
4
+ https://github.com/kpu/kenlm/archive/master.zip