C2MV commited on
Commit
654d501
·
verified ·
1 Parent(s): f94ef87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -43,5 +43,17 @@ def main():
43
  raise ve
44
 
45
 
46
- if __name__ == "__main__":
47
- main(share=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  raise ve
44
 
45
 
46
+ if __name__ == '__main__':
47
+ # For local execution without explicit share=True, Gradio might choose a local URL.
48
+ # share=True is useful for Colab or when needing external access.
49
+ # For robust execution, explicitly manage the server if needed.
50
+ # Check if running in a Google Colab environment
51
+ try:
52
+ import google.colab
53
+ IN_COLAB = True
54
+ except:
55
+ IN_COLAB = False
56
+
57
+ demo_instance = create_interface()
58
+ # demo_instance.launch(share=IN_COLAB) # Share only if in Colab, otherwise local
59
+ demo_instance.launch(share=True) # Force share for testing purposes