lorenzoscottb commited on
Commit
4e909b7
Β·
1 Parent(s): c4a4b60

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import os
 
2
  import gradio as gr
3
  from gradio.mix import Series
4
 
@@ -8,6 +9,15 @@ read_token = str(os.environ['read_token'])
8
  description = "Talk to Breud!"
9
  title = "Breud (BERT + Freud)"
10
 
 
 
 
 
 
 
 
 
 
11
  wisper = gr.Interface.load("models/openai/whisper-base")
12
 
13
  interface_model_L = gr.Interface.load(
@@ -16,6 +26,7 @@ interface_model_L = gr.Interface.load(
16
  )
17
 
18
  Series(
 
19
  wisper,
20
  interface_model_L,
21
  description = description,
 
1
  import os
2
+ import numpy as np
3
  import gradio as gr
4
  from gradio.mix import Series
5
 
 
9
  description = "Talk to Breud!"
10
  title = "Breud (BERT + Freud)"
11
 
12
+ def reverse_audio(audio):
13
+ sr, data = audio
14
+ reversed_audio = (sr, np.flipud(data))
15
+ return reversed_audio
16
+
17
+
18
+ mic = gr.Audio(source="microphone", type="numpy", label="Speak here...")
19
+ audio_int = gr.Interface(reverse_audio, mic, "audio")
20
+
21
  wisper = gr.Interface.load("models/openai/whisper-base")
22
 
23
  interface_model_L = gr.Interface.load(
 
26
  )
27
 
28
  Series(
29
+ audio_int,
30
  wisper,
31
  interface_model_L,
32
  description = description,