Spaces:
Running on Zero
Running on Zero
Download app.py from cipher-attacks/Dbu-central-bot: direct link, hf CLI and curl.
- Browser
- Download file 729 Bytes
-
https://huggingface.co/spaces/cipher-attacks/Dbu-central-bot/resolve/main/app.py
- Command line
-
hf download hf://spaces/cipher-attacks/Dbu-central-bot/app.py
-
curl -L -o app.py https://huggingface.co/spaces/cipher-attacks/Dbu-central-bot/resolve/main/app.py
729 Bytes
| """Hugging Face Space entrypoint (Gradio SDK). | |
| Gradio only serves a tiny status page (also used for uptime pings). | |
| The Telegram bot runs in a background thread. | |
| """ | |
| import asyncio | |
| import threading | |
| import gradio as gr | |
| try: # ZeroGPU Spaces expect at least one @spaces.GPU function | |
| import spaces | |
| def _noop(): | |
| return "ok" | |
| except ImportError: # running locally | |
| pass | |
| from app.main import run_bot_forever | |
| def _runner() -> None: | |
| asyncio.run(run_bot_forever()) | |
| threading.Thread(target=_runner, daemon=True, name="telegram-bot").start() | |
| with gr.Blocks(title="DBU Central Bot") as demo: | |
| gr.Markdown("### DBU Central Bot is running ✅") | |
| if __name__ == "__main__": | |
| demo.launch() | |