Spaces:
Sleeping
Sleeping
Download app.py from elijahg6514/godbot-node: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/elijahg6514/godbot-node/resolve/main/app.py
- Command line
-
hf download hf://spaces/elijahg6514/godbot-node/app.py
-
curl -L -o app.py https://huggingface.co/spaces/elijahg6514/godbot-node/resolve/main/app.py
1.18 kB
| import gradio as gr | |
| import requests, threading, time | |
| from datetime import datetime | |
| PRIMARY = "162.243.238.36" | |
| def announce(): | |
| while True: | |
| try: | |
| requests.post(f"http://{PRIMARY}:7861/mesh", json={ | |
| "action":"announce","node_id":"godbot-hf-space", | |
| "role":"edge","ip":"huggingface.co","port":7860, | |
| "models":[],"ram_mb":16000,"skills":0 | |
| }, timeout=8) | |
| except: pass | |
| time.sleep(55) | |
| threading.Thread(target=announce, daemon=True).start() | |
| def status(): | |
| try: | |
| r = requests.get(f"http://{PRIMARY}:7861/mesh/ping", timeout=5).json() | |
| c = requests.get(f"http://{PRIMARY}:7861/mesh/capabilities", timeout=5).json() | |
| return f"GodBot Mesh Node - HuggingFace Space\nConnected: {r.get('node_id')}\nPrimary skills: {c.get('skills')} | Models: {len(c.get('models',[]))}\nUpdated: {datetime.utcnow().strftime('%H:%M UTC')}" | |
| except Exception as e: | |
| return f"Primary unreachable: {e}\nNode alive." | |
| gr.Interface(fn=status, inputs=[], outputs=gr.Textbox(lines=5), | |
| title="GodBot Mesh Node", description="Autonomous AI agent - free persistent compute").launch() | |