Dbu-central-bot / app.py
cipher-attacks's picture
stage 1
b37ebd1
Raw History Blame Contribute Delete
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
@spaces.GPU
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()