scvcoder commited on
Commit
f22d865
·
verified ·
1 Parent(s): 25e54de

Fix diag import path (spaces.config not spaces.zero.config); SPACES_ZERO_GPU=1 confirmed

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -58,7 +58,13 @@ print(f"[kpaa-backend] SPACE_ID={os.environ.get('SPACE_ID')!r}", flush=True)
58
 
59
  import spaces # noqa: E402
60
 
61
- print(f"[kpaa-backend] spaces.Config.zero_gpu={spaces.zero.config.Config.zero_gpu}", flush=True)
 
 
 
 
 
 
62
 
63
 
64
  @spaces.GPU(duration=1)
@@ -67,8 +73,8 @@ def _zerogpu_startup_canary() -> None:
67
 
68
 
69
  print(
70
- f"[kpaa-backend] canary marked? "
71
- f"{getattr(_zerogpu_startup_canary, 'zerogpu', 'NO')}",
72
  flush=True,
73
  )
74
  # ──────────────────────────────────────────────────────────────────────────
 
58
 
59
  import spaces # noqa: E402
60
 
61
+ # Correct import path: Config lives at spaces.config.Config (top-level config module),
62
+ # not spaces.zero.config. Wrapped in try so a future API change doesn't crash startup.
63
+ try:
64
+ from spaces.config import Config as _spcfg
65
+ print(f"[kpaa-backend] spaces.Config.zero_gpu={_spcfg.zero_gpu}", flush=True)
66
+ except Exception as e:
67
+ print(f"[kpaa-backend] could not read spaces.Config: {e!r}", flush=True)
68
 
69
 
70
  @spaces.GPU(duration=1)
 
73
 
74
 
75
  print(
76
+ f"[kpaa-backend] canary 'zerogpu' attr: "
77
+ f"{getattr(_zerogpu_startup_canary, 'zerogpu', '<not set — decorator was no-op>')}",
78
  flush=True,
79
  )
80
  # ──────────────────────────────────────────────────────────────────────────