dkappe commited on
Commit
2be1104
·
verified ·
1 Parent(s): 440443e

IDU 0.2.0: add decider-4b as a second backend

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -749,17 +749,18 @@ def health():
749
  "the GPU worker and model_in_web_process will read False by design.")}
750
 
751
 
 
752
  def warmup_decider() -> dict:
753
  """Build decider-4b and run one real decision, so both backends are warm at startup.
754
 
755
- This is the part that costs real memory: laya is 421M and decider is 4.2B, and both sit
756
- in the same Space. Kept separate from `warmup` so a decider failure cannot take Laya
757
- down with it -- the two are independent services sharing a UI.
 
 
758
 
759
- The model is built on CPU at module scope and moved onto the GPU HERE, which mirrors the
760
- Laya path: on ZeroGPU a device exists only inside a decorated call, so building on
761
- "cuda" at import time is not possible. `_decider_move_to_gpu` degrades to CPU rather
762
- than raising, so this returns a result either way and the device is reported.
763
  """
764
  try:
765
  get_decider()
 
749
  "the GPU worker and model_in_web_process will read False by design.")}
750
 
751
 
752
+ @GPU
753
  def warmup_decider() -> dict:
754
  """Build decider-4b and run one real decision, so both backends are warm at startup.
755
 
756
+ DECORATED WITH @GPU, which is not optional here. Without it this runs outside any GPU
757
+ context: on ZeroGPU `torch.cuda.is_available()` can still report True while no device is
758
+ actually attached, so moving the model fails inside the CUDA runtime with
759
+ "no CUDA-capable device is detected". The decorated call is the only place a device
760
+ exists.
761
 
762
+ Kept separate from `warmup` so a decider failure cannot take Laya down with it -- the
763
+ two are independent services sharing a UI.
 
 
764
  """
765
  try:
766
  get_decider()