Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -79,7 +79,7 @@ STREAM_WIDTH = 1280
|
|
| 79 |
JPEG_QUALITY = 82
|
| 80 |
MAX_BLOCKS_PER_SESSION = 512 # hard cap so a session can't run forever
|
| 81 |
SESSION_IDLE_TIMEOUT = 600 # seconds; janitor reaps abandoned sessions
|
| 82 |
-
GPU_DURATION =
|
| 83 |
|
| 84 |
# ββ Real-time pacing configuration βββββββββββββββββββββββββββββββββββββββββββ
|
| 85 |
# The GPU decodes a whole block (NUM_FPB frames) at once, so all of a block's
|
|
@@ -386,7 +386,7 @@ def create_gpu_rollout_loop(command_queue, seed_path, prompt_text, seed):
|
|
| 386 |
Only picklable primitives + the multiprocessing `command_queue` cross the
|
| 387 |
fork boundary. Live controls (held key set) and stop arrive via that queue.
|
| 388 |
"""
|
| 389 |
-
@spaces.GPU(duration=GPU_DURATION
|
| 390 |
def gpu_rollout():
|
| 391 |
device = torch.device("cuda")
|
| 392 |
prompt = (prompt_text or DEFAULT_PROMPT).strip() or DEFAULT_PROMPT
|
|
|
|
| 79 |
JPEG_QUALITY = 82
|
| 80 |
MAX_BLOCKS_PER_SESSION = 512 # hard cap so a session can't run forever
|
| 81 |
SESSION_IDLE_TIMEOUT = 600 # seconds; janitor reaps abandoned sessions
|
| 82 |
+
GPU_DURATION = 90 # seconds per @spaces.GPU allocation
|
| 83 |
|
| 84 |
# ββ Real-time pacing configuration βββββββββββββββββββββββββββββββββββββββββββ
|
| 85 |
# The GPU decodes a whole block (NUM_FPB frames) at once, so all of a block's
|
|
|
|
| 386 |
Only picklable primitives + the multiprocessing `command_queue` cross the
|
| 387 |
fork boundary. Live controls (held key set) and stop arrive via that queue.
|
| 388 |
"""
|
| 389 |
+
@spaces.GPU(duration=GPU_DURATION)
|
| 390 |
def gpu_rollout():
|
| 391 |
device = torch.device("cuda")
|
| 392 |
prompt = (prompt_text or DEFAULT_PROMPT).strip() or DEFAULT_PROMPT
|