Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -244,14 +244,18 @@ if __name__ == "__main__":
|
|
244 |
HF_SPACE = os.getenv("HF_SPACE", False)
|
245 |
PORT = int(os.getenv("PORT", 7860))
|
246 |
|
|
|
|
|
|
|
247 |
# Remove debug code in production
|
248 |
import fastrtc
|
249 |
print(f"FastRTC version: {fastrtc.__version__ if hasattr(fastrtc, '__version__') else 'unknown'}")
|
250 |
|
251 |
# Launch with web interface (appropriate for Hugging Face Spaces)
|
|
|
252 |
stream.ui.launch(
|
253 |
server_name="0.0.0.0", # Bind to all interfaces
|
254 |
server_port=PORT,
|
255 |
share=False, # No need for sharing on HF Spaces
|
256 |
-
debug=False # Disable debug in production
|
257 |
)
|
|
|
244 |
HF_SPACE = os.getenv("HF_SPACE", False)
|
245 |
PORT = int(os.getenv("PORT", 7860))
|
246 |
|
247 |
+
# Print debug information about port
|
248 |
+
print(f"Using port: {PORT}")
|
249 |
+
|
250 |
# Remove debug code in production
|
251 |
import fastrtc
|
252 |
print(f"FastRTC version: {fastrtc.__version__ if hasattr(fastrtc, '__version__') else 'unknown'}")
|
253 |
|
254 |
# Launch with web interface (appropriate for Hugging Face Spaces)
|
255 |
+
# Explicitly use the PORT from environment variable
|
256 |
stream.ui.launch(
|
257 |
server_name="0.0.0.0", # Bind to all interfaces
|
258 |
server_port=PORT,
|
259 |
share=False, # No need for sharing on HF Spaces
|
260 |
+
debug=False, # Disable debug in production
|
261 |
)
|