Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,4 +69,12 @@ stream = Stream(
|
|
| 69 |
)
|
| 70 |
|
| 71 |
if __name__ == "__main__":
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
)
|
| 70 |
|
| 71 |
if __name__ == "__main__":
|
| 72 |
+
import uvicorn
|
| 73 |
+
import os
|
| 74 |
+
|
| 75 |
+
# Hugging Face Spaces provides the port via an environment variable,
|
| 76 |
+
# but defaults to 7860.
|
| 77 |
+
port = int(os.getenv("PORT", 7860))
|
| 78 |
+
|
| 79 |
+
# We bind to 0.0.0.0 to make the app accessible within the HF container
|
| 80 |
+
uvicorn.run(app, host="0.0.0.0", port=port)
|