Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -86,8 +86,15 @@ def gradio_file_interface(uploaded_file):
|
|
86 |
return label
|
87 |
|
88 |
def gradio_mic_interface(mic_input):
|
89 |
-
# mic_input is a
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
label = "Hypernasality Detected" if prediction == 1 else "No Hypernasality Detected"
|
92 |
return label
|
93 |
|
|
|
86 |
return label
|
87 |
|
88 |
def gradio_mic_interface(mic_input):
|
89 |
+
# Assuming mic_input is a tuple with the audio data and sample rate
|
90 |
+
if isinstance(mic_input, tuple):
|
91 |
+
audio_data, sample_rate = mic_input
|
92 |
+
else:
|
93 |
+
# If it's not a tuple, we will try to extract data as if it's a dict
|
94 |
+
audio_data = mic_input['data']
|
95 |
+
sample_rate = mic_input['sample_rate']
|
96 |
+
|
97 |
+
prediction = predict(audio_data, sample_rate, config)
|
98 |
label = "Hypernasality Detected" if prediction == 1 else "No Hypernasality Detected"
|
99 |
return label
|
100 |
|