moraxgiga commited on
Commit
b00fa8b
·
1 Parent(s): e48c9d7

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +24 -0
  2. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Let's get pipelines from transformers
2
+ from transformers import pipeline
3
+ # Let's import Gradio
4
+ import gradio as gr
5
+
6
+ # Let's set up the model
7
+ model = pipeline("automatic-speech-recognition", model="moraxgiga/audio_test")
8
+ title = "Audio2Text"
9
+ description = "Record your audio in English and send it in order to received a transcription"
10
+
11
+
12
+ # Function
13
+ def transcribe(audio):
14
+ # Let's invoke "model" defined above
15
+ text = model(audio)["text"]
16
+ return text
17
+
18
+
19
+ # Interface Set-Up
20
+ gr.Interface(
21
+ fn=transcribe,
22
+ inputs=[gr.Audio(source="microphone", type="filepath")],
23
+ outputs=["textbox"]
24
+ ).launch()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ torch
2
+ transformers