Download lichess-bot.py from Hectozar/CBot: direct link, hf CLI and curl.
- Browser
- Download file 391 Bytes
-
https://huggingface.co/spaces/Hectozar/CBot/resolve/main/lichess-bot.py
- Command line
-
hf download hf://spaces/Hectozar/CBot/lichess-bot.py
-
curl -L -o lichess-bot.py https://huggingface.co/spaces/Hectozar/CBot/resolve/main/lichess-bot.py
391 Bytes
| import threading | |
| from http.server import SimpleHTTPRequestHandler, HTTPServer | |
| def run_dummy_server(): | |
| # Hugging Face looks for port 7860 by default | |
| server = HTTPServer(('0.0.0.0', 7860), SimpleHTTPRequestHandler) | |
| server.serve_forever() | |
| # Start the server in a separate background thread so it doesn't block the bot | |
| threading.Thread(target=run_dummy_server, daemon=True).start() |