Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -113,12 +113,18 @@ def predict_audio(audio_file_path):
|
|
| 113 |
|
| 114 |
# Create and launch Gradio interface
|
| 115 |
if model is not None:
|
| 116 |
-
|
| 117 |
fn=predict_audio,
|
| 118 |
inputs=gr.Audio(type="filepath"),
|
| 119 |
outputs=gr.Label(),
|
| 120 |
title="Audio Code-Switching Detector",
|
| 121 |
-
description="Upload an audio file to detect code-switching.",
|
| 122 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
interface.launch(server_name="127.0.0.1", server_port=7860)
|
| 124 |
|
|
|
|
| 113 |
|
| 114 |
# Create and launch Gradio interface
|
| 115 |
if model is not None:
|
| 116 |
+
interface = gr.Interface(
|
| 117 |
fn=predict_audio,
|
| 118 |
inputs=gr.Audio(type="filepath"),
|
| 119 |
outputs=gr.Label(),
|
| 120 |
title="Audio Code-Switching Detector",
|
| 121 |
+
description="Upload an audio file to detect if it contains code-switching.",
|
| 122 |
)
|
| 123 |
+
|
| 124 |
+
# Launch Gradio with a public share link
|
| 125 |
+
interface.launch(share=True)
|
| 126 |
+
else:
|
| 127 |
+
print("Gradio interface not created due to model loading error.")
|
| 128 |
+
|
| 129 |
interface.launch(server_name="127.0.0.1", server_port=7860)
|
| 130 |
|