Spaces:
Sleeping
Sleeping
Rajan Sharma
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -285,7 +285,15 @@ with gr.Blocks(theme=theme, css=custom_css) as demo:
|
|
| 285 |
)
|
| 286 |
|
| 287 |
if __name__ == "__main__":
|
| 288 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 289 |
|
| 290 |
|
| 291 |
|
|
|
|
| 285 |
)
|
| 286 |
|
| 287 |
if __name__ == "__main__":
|
| 288 |
+
# Hugging Face Spaces expects the app to listen on $PORT and 0.0.0.0
|
| 289 |
+
port = int(os.environ.get("PORT", "7860"))
|
| 290 |
+
demo.launch(
|
| 291 |
+
server_name="0.0.0.0",
|
| 292 |
+
server_port=port,
|
| 293 |
+
show_api=False, # optional: less overhead
|
| 294 |
+
max_threads=8, # optional: avoid thread-starvation on tiny CPUs
|
| 295 |
+
)
|
| 296 |
+
|
| 297 |
|
| 298 |
|
| 299 |
|