# gunicorn.conf.py import os # Use an asynchronous worker compatible with asyncio # uvicorn.workers.UvicornWorker is generally recommended worker_class = 'uvicorn.workers.UvicornWorker' # Number of workers (adjust based on Space resources if needed) workers = int(os.environ.get('GUNICORN_WORKERS', '2')) # Example: default 2 # Bind to the port specified by Hugging Face Spaces or default bind = f"0.0.0.0:{os.environ.get('PORT', '7860')}" # Logging (optional, Gunicorn default logs are usually fine) # loglevel = 'debug' # accesslog = '-' # Log access to stdout # errorlog = '-' # Log errors to stdout # Timeout (optional, increase if needed for long requests) # timeout = 120