Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
|
|
|
5 |
|
6 |
def transcribe(audio):
|
7 |
-
|
|
|
8 |
return text
|
9 |
|
|
|
|
|
|
|
|
|
10 |
gr.Interface(
|
11 |
fn=transcribe,
|
12 |
-
inputs=
|
13 |
outputs="text").launch()
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
# Specify the task for the pipeline
|
5 |
+
p = pipeline('text-generation', model='wannaphong/wav2vec2-large-xlsr-53-th-cv8-deepcut')
|
6 |
|
7 |
def transcribe(audio):
|
8 |
+
# Pass the audio file to the pipeline and obtain the output
|
9 |
+
text = p(audio)["generated_text"]
|
10 |
return text
|
11 |
|
12 |
+
# Create a GraudioInput object for the audio input
|
13 |
+
audio_input = gr.Audio(source="microphone", type="filepath")
|
14 |
+
|
15 |
+
# Use the GraudioInput object as the value for the inputs argument
|
16 |
gr.Interface(
|
17 |
fn=transcribe,
|
18 |
+
inputs=audio_input,
|
19 |
outputs="text").launch()
|