John Walley commited on
Commit
311ef36
·
1 Parent(s): 3b5bcef
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -22,6 +22,7 @@ from ultralytics import YOLO
22
  import random
23
  from typing import Tuple, List, Dict
24
  import time
 
25
 
26
 
27
  # ============================================================================
@@ -490,4 +491,6 @@ def create_interface():
490
 
491
  if __name__ == "__main__":
492
  demo = create_interface()
493
- demo.launch(share=True)
 
 
 
22
  import random
23
  from typing import Tuple, List, Dict
24
  import time
25
+ import os
26
 
27
 
28
  # ============================================================================
 
491
 
492
  if __name__ == "__main__":
493
  demo = create_interface()
494
+ # Only use share=True for local development (not on HF Spaces)
495
+ is_spaces = os.getenv("SPACE_ID") is not None
496
+ demo.launch(share=not is_spaces)