Spaces:
Running
Running
Fix typo
Browse files
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 |
-
|
|
|
|
| 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)
|