jcho02 commited on
Commit
f4739ca
·
verified ·
1 Parent(s): 3f0b580

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
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 dictionary with 'data' and 'sample_rate' keys
90
- prediction = predict(mic_input['data'], mic_input['sample_rate'], config)
 
 
 
 
 
 
 
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