hagenw commited on
Commit
6c903be
·
1 Parent(s): d6e9096
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -111,7 +111,7 @@ def recognize(file, output_selector):
111
  signal, sampling_rate = audiofile.read(file, duration=duration)
112
  age_gender = process_func(signal, sampling_rate)
113
  if output_selector == "age":
114
- return f"{round(age_gender['age']} years"
115
  else:
116
  return {k: v for k, v in age_gender.items() if k != "age"}
117
 
@@ -164,7 +164,8 @@ with gr.Blocks() as demo:
164
 
165
  def update_output(output_selector):
166
  """Set different output types for different model outputs."""
167
- output = gr.Label(label="gender")
 
168
  return output
169
 
170
  output_selector.input(update_output, output_selector, output)
 
111
  signal, sampling_rate = audiofile.read(file, duration=duration)
112
  age_gender = process_func(signal, sampling_rate)
113
  if output_selector == "age":
114
+ return f"{round(age_gender['age'])} years"
115
  else:
116
  return {k: v for k, v in age_gender.items() if k != "age"}
117
 
 
164
 
165
  def update_output(output_selector):
166
  """Set different output types for different model outputs."""
167
+ if output_selector == "gender":
168
+ output = gr.Label(label="gender")
169
  return output
170
 
171
  output_selector.input(update_output, output_selector, output)