Spaces:
Running on Zero
Running on Zero
Download app.py from Agnivesh10M/src: direct link, hf CLI and curl.
- Browser
- Download file 887 Bytes
-
https://huggingface.co/spaces/Agnivesh10M/src/resolve/main/app.py
- Command line
-
hf download hf://spaces/Agnivesh10M/src/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Agnivesh10M/src/resolve/main/app.py
887 Bytes
| 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 फंक्शन | |
| 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) | |