arahrooh commited on
Commit
4c09fcb
·
1 Parent(s): 237ee8e

Prevent main() from running on Spaces

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -885,4 +885,6 @@ else:
885
 
886
  # For local execution only (not on Spaces)
887
  if __name__ == "__main__":
888
- main()
 
 
 
885
 
886
  # For local execution only (not on Spaces)
887
  if __name__ == "__main__":
888
+ # Don't run main() on Spaces - demo is already created at module level
889
+ if not (os.getenv("SPACE_ID") or os.getenv("SYSTEM") == "spaces"):
890
+ main()