Spaces:
Runtime error
Runtime error
Prevent main() from running on Spaces
Browse files
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()
|