Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -891,9 +891,13 @@ def main():
|
|
| 891 |
app = create_gradio_interface()
|
| 892 |
|
| 893 |
# Launch the app
|
|
|
|
|
|
|
|
|
|
|
|
|
| 894 |
app.launch(
|
| 895 |
server_name="0.0.0.0",
|
| 896 |
-
server_port=
|
| 897 |
share=False,
|
| 898 |
show_error=True,
|
| 899 |
quiet=False
|
|
|
|
| 891 |
app = create_gradio_interface()
|
| 892 |
|
| 893 |
# Launch the app
|
| 894 |
+
# For Hugging Face Spaces, use environment variable for port
|
| 895 |
+
import os
|
| 896 |
+
port = int(os.environ.get("GRADIO_SERVER_PORT", 7860))
|
| 897 |
+
|
| 898 |
app.launch(
|
| 899 |
server_name="0.0.0.0",
|
| 900 |
+
server_port=port,
|
| 901 |
share=False,
|
| 902 |
show_error=True,
|
| 903 |
quiet=False
|