radames commited on
Commit
d10b0e3
·
1 Parent(s): 787d4c4
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from gradio_client import Client
2
+ def transcribe(audio, state=""):
3
+ client = Client( "abidlabs/whisper")
4
+ time.sleep(2)
5
+ text = client.predict(audio, api_name = '/predict')
6
+ state += text + " "
7
+ return state, state
8
+
9
+ # Set the starting state to an empty string
10
+ iface = gr. Interface(fn=transcribe,
11
+ inputs=[gr.Audio(source="microphone", type="filepath", streaming-True)," state"],
12
+ outputs=["textbox","state" ],
13
+ live=True)
14
+ iface.launch(share=True)