Spaces:
Sleeping
Sleeping
Commit ·
0fafc9b
1
Parent(s): 820f0a7
Add @spaces.GPU warmup to satisfy ZeroGPU requirement
Browse files123456789101112131415161736 unmodified lines5455565758#!/usr/bin/env python3"""FALL (SwarmNet) - Hugging Face Space Production EntrypointRuns on standard CPU basic or ZeroGPU runtime."""import sysimport osimport subprocessimport timeimport gradio as grROOT_DIR = os.path.abspath(os.path.dirname(__file__))sys.path.insert(0, ROOT_DIR)# 1. Start Miner 1 (Layers 0 to 14) in backgroundprint("⚡ Starting Swarm Miner 01 (Layers 0-14)...")env = os.environ.copy()36 unmodified lines# gr.mount_gradio_app modifies and returns the FastAPI appapp = gr.mount_gradio_app(fastapi_app, gr.Blocks(), path="/gradio")# Also provide demo reference for Hugging Face Spaces supervisordemo = app12345678910111213141516171819202122232425262728293036 unmodified lines6768697071#!/usr/bin/env python3"""FALL (SwarmNet) - Hugging Face Space Production EntrypointCompatible with ZeroGPU and CPU runtimes."""import sysimport osimport subprocessimport timeROOT_DIR = os.path.abspath(os.path.dirname(__file__))sys.path.insert(0, ROOT_DIR)# Handle ZeroGPU @spaces.GPU decorator if running under spaces runtimetry:import spaces@spaces.GPUdef zerogpu_warmup():"""Satisfies ZeroGPU startup check"""import torchreturn torch.cuda.is_available()zerogpu_warmup()except Exception:passimport gradio as gr# 1. Start Miner 1 (Layers 0 to 14) in backgroundprint("⚡ Starting Swarm Miner 01 (Layers 0-14)...")env = os.environ.copy()36 unmodified lines# gr.mount_gradio_app modifies and returns the FastAPI appapp = gr.mount_gradio_app(fastapi_app, gr.Blocks(), path="/gradio")# Export for Hugging Face Spaces Gradio runnerdemo = app
app.py+16-3