Spaces:
Sleeping
Sleeping
Download app.py from HSR-DeepThink/Perhance: direct link, hf CLI and curl.
- Browser
- Download file 686 Bytes
-
https://huggingface.co/spaces/HSR-DeepThink/Perhance/resolve/main/app.py
- Command line
-
hf download hf://spaces/HSR-DeepThink/Perhance/app.py
-
curl -L -o app.py https://huggingface.co/spaces/HSR-DeepThink/Perhance/resolve/main/app.py
686 Bytes
| import os | |
| import threading | |
| import sys | |
| from flask import Flask | |
| app = Flask(__name__) | |
| def home(): | |
| return "Lichess Bot Wrapper is running!" | |
| def run_lichess_core(): | |
| # flush=True forces the log to print instantly on Hugging Face | |
| print("Launching Lichess Bot process...", flush=True) | |
| # The "-u" flag turns on unbuffered output for the main bot script | |
| os.system("python3 -u lichess-bot.py") | |
| if __name__ == "__main__": | |
| # Runs the actual bot logic in a background loop | |
| threading.Thread(target=run_lichess_core, daemon=True).start() | |
| # Keeps Hugging Face happy by listening on the mandatory port | |
| app.run(host="0.0.0.0", port=7860) | |