import subprocess import threading import gradio as gr import spaces # बॉट को बैकग्राउंड में शुरू करने का फंक्शन def run_bot(): subprocess.run(["python3", "bot.py"]) # बैकग्राउंड थ्रेड में बॉट चालू करना threading.Thread(target=run_bot, daemon=True).start() # ZeroGPU के लिए डमी GPU फंक्शन @spaces.GPU def keep_alive(): return "Bot is running on ZeroGPU" # Gradio वेब इंटरफेस with gr.Blocks() as demo: gr.Markdown("# 🤖 SACHIN SHARMA Bot is Running 24/7!") output_text = gr.Textbox(value="Bot is active", label="Status") btn = gr.Button("Check Status") btn.click(fn=keep_alive, outputs=output_text) if __name__ == "__main__": demo.launch(server_name="0.0.0.0", server_port=7860)