Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -858,15 +858,18 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
858 |
|
859 |
if __name__ == "__main__":
|
860 |
try:
|
861 |
-
#
|
862 |
-
|
|
|
|
|
|
|
863 |
except Exception as e:
|
864 |
import traceback
|
865 |
print(f"Error launching demo: {traceback.format_exc()}")
|
866 |
print("\nTrying alternative launch method...")
|
867 |
try:
|
868 |
-
# Alternative launch method
|
869 |
-
demo.launch(share=False, debug=True
|
870 |
except Exception as e2:
|
871 |
print(f"Alternative launch also failed: {str(e2)}")
|
872 |
print("\nPlease check your Gradio installation and try again.")
|
|
|
858 |
|
859 |
if __name__ == "__main__":
|
860 |
try:
|
861 |
+
# Use options compatible with Gradio 3.42.0
|
862 |
+
import os
|
863 |
+
# Disable file watching to prevent restart loops
|
864 |
+
os.environ['GRADIO_WATCH'] = 'no'
|
865 |
+
demo.launch(prevent_thread_lock=True)
|
866 |
except Exception as e:
|
867 |
import traceback
|
868 |
print(f"Error launching demo: {traceback.format_exc()}")
|
869 |
print("\nTrying alternative launch method...")
|
870 |
try:
|
871 |
+
# Alternative launch method
|
872 |
+
demo.launch(share=False, debug=True)
|
873 |
except Exception as e2:
|
874 |
print(f"Alternative launch also failed: {str(e2)}")
|
875 |
print("\nPlease check your Gradio installation and try again.")
|