capradeepgujaran commited on
Commit
1f0ad8d
·
verified ·
1 Parent(s): 8bded3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -2
app.py CHANGED
@@ -285,6 +285,19 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as iface:
285
  """
286
  )
287
 
288
- # Launch the app
289
  if __name__ == "__main__":
290
- iface.launch(debug=True, share=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  """
286
  )
287
 
 
288
  if __name__ == "__main__":
289
+ try:
290
+ # Attempt to launch with sharing enabled
291
+ iface.launch(debug=True, share=True)
292
+ except Exception as e:
293
+ logger.error(f"Error when trying to launch with sharing: {str(e)}")
294
+ logger.error(traceback.format_exc())
295
+
296
+ # If sharing fails, try to launch without sharing
297
+ try:
298
+ logger.info("Attempting to launch without sharing...")
299
+ iface.launch(debug=True, share=False)
300
+ except Exception as e:
301
+ logger.error(f"Error when trying to launch without sharing: {str(e)}")
302
+ logger.error(traceback.format_exc())
303
+ print("Failed to launch the Gradio interface. Please check the logs for more information.")