Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,21 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
-
from sad_tf import *
|
3 |
|
4 |
-
def
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
|
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 |
-
|
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()
|
|