from flask import Flask import os app = Flask(__name__) @app.route('/') def hello_world(): # This page will be pinged to keep the Space alive return "Bot is alive and running!" if __name__ == "__main__": # Hugging Face Spaces expect the app to run on port 7860 port = int(os.environ.get("PORT", 7860)) # Use 0.0.0.0 to be accessible within the Docker container app.run(host='0.0.0.0', port=port)