imansarraf commited on
Commit
b50bfc8
·
verified ·
1 Parent(s): 296f0d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -13
app.py CHANGED
@@ -1,17 +1,21 @@
 
1
  import gradio as gr
2
- from sad_tf import *
3
 
4
- def transcribe_audio(audio_file):
5
- return "ok"
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- # Define the Gradio interface
8
- interface = gr.Interface(
9
- fn=transcribe_audio,
10
- inputs=gr.Audio(type="filepath"), # Removed 'source="microphone"'
11
- outputs="text",
12
- title="Audio Transcription",
13
- description="Upload an audio file or record audio to get the transcription."
14
- )
15
 
16
- # Launch the Gradio app
17
- interface.launch()
 
1
+
2
  import gradio as gr
 
3
 
4
+ def process_audio(audio):
5
+
6
+ if isinstance(audio, str):
7
+ return (audio)
8
+ else:
9
+ return "Processed audio output"
10
+
11
+ with gr.Blocks() as iface:
12
+ with gr.Row():
13
+ audio_in = gr.Audio(source="microphone", type="filepath")
14
+ file_in = gr.File(file_type="audio")
15
+
16
+ output = gr.Textbox()
17
 
18
+ inputs = [audio_in, file_in]
19
+ iface.submit(fn=process_audio, inputs=inputs, outputs=output)
 
 
 
 
 
 
20
 
21
+ iface.launch()