Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -148,10 +148,10 @@ def infer(audio_path, sensitivity):
|
|
| 148 |
return md
|
| 149 |
|
| 150 |
# ----------------------------
|
| 151 |
-
# 6) Gradio Blocks interface
|
| 152 |
# ----------------------------
|
| 153 |
with gr.Blocks() as demo:
|
| 154 |
-
gr.Markdown("# 🐸 RibbID – Amphibian Call Identifier")
|
| 155 |
gr.Markdown(
|
| 156 |
"**Detection strictness** controls how conservative the model is:\n\n"
|
| 157 |
"- Lower values (0.5) = more sensitive (may include false positives).\n"
|
|
@@ -163,11 +163,15 @@ with gr.Blocks() as demo:
|
|
| 163 |
slider = gr.Slider(0.5, 1.0, value=1.0, step=0.05,
|
| 164 |
label="Detection strictness")
|
| 165 |
|
| 166 |
-
|
| 167 |
-
output = gr.Markdown()
|
| 168 |
|
| 169 |
btn = gr.Button("Submit")
|
| 170 |
-
btn.click(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
|
| 172 |
if __name__ == "__main__":
|
| 173 |
demo.launch(share=False)
|
|
|
|
| 148 |
return md
|
| 149 |
|
| 150 |
# ----------------------------
|
| 151 |
+
# 6) Gradio Blocks interface
|
| 152 |
# ----------------------------
|
| 153 |
with gr.Blocks() as demo:
|
| 154 |
+
gr.Markdown("# 🐸 RibbID – Amphibian Call Identifier\n")
|
| 155 |
gr.Markdown(
|
| 156 |
"**Detection strictness** controls how conservative the model is:\n\n"
|
| 157 |
"- Lower values (0.5) = more sensitive (may include false positives).\n"
|
|
|
|
| 163 |
slider = gr.Slider(0.5, 1.0, value=1.0, step=0.05,
|
| 164 |
label="Detection strictness")
|
| 165 |
|
| 166 |
+
output = gr.Markdown()
|
|
|
|
| 167 |
|
| 168 |
btn = gr.Button("Submit")
|
| 169 |
+
btn.click(
|
| 170 |
+
fn=infer,
|
| 171 |
+
inputs=[audio, slider],
|
| 172 |
+
outputs=[output],
|
| 173 |
+
show_progress=True # <-- esto activa el spinner desde el primer click
|
| 174 |
+
)
|
| 175 |
|
| 176 |
if __name__ == "__main__":
|
| 177 |
demo.launch(share=False)
|