Moremoholo2 commited on
Commit
ddcdf91
·
verified ·
1 Parent(s): 2ba6a81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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
- iface = 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 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