Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
pipe = pipeline("automatic-speech-recognition", model="jonatasgrosman/wav2vec2-large-xlsr-53-english")
|
5 |
+
|
6 |
+
pipe2 = pipeline("summarization", model="facebook/bart-large-cnn")
|
7 |
+
|
8 |
+
def launch(input):
|
9 |
+
out = pipe(input)
|
10 |
+
out2 = pipe2(input)
|
11 |
+
return out[0]['audio']
|
12 |
+
|
13 |
+
iface = gr.Interface(launch,
|
14 |
+
inputs=gr.Image(type='pil'),
|
15 |
+
outputs="text")
|
16 |
+
|
17 |
+
iface.launch()
|