VirtualOasis commited on
Commit
c44ce69
·
verified ·
1 Parent(s): 042d9ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -12,6 +12,13 @@ try: # pragma: no cover - spaces is only available inside HF Spaces
12
  except Exception: # pragma: no cover - keep local dev working without spaces pkg
13
  spaces = None # type: ignore
14
 
 
 
 
 
 
 
 
15
  STYLE_CHOICES = [
16
  "Cinematic Realism",
17
  "Neo-Noir Animation",
@@ -36,10 +43,8 @@ def gpu_guard(duration: int = 120):
36
  if not spaces:
37
  return fn
38
  return spaces.GPU(duration=duration)(fn)
39
-
40
  return decorator
41
 
42
-
43
  def _character_dropdown_update(board: Storyboard | None):
44
  if not board or not board.characters:
45
  return gr.update(choices=[], value=None, interactive=False)
 
12
  except Exception: # pragma: no cover - keep local dev working without spaces pkg
13
  spaces = None # type: ignore
14
 
15
+ if spaces:
16
+ @spaces.GPU(duration=60) # short duration is enough
17
+ def __cinegen_gpu_warmup():
18
+ """Dummy function — never called, only exists to satisfy HF Spaces GPU detection"""
19
+ pass
20
+
21
+
22
  STYLE_CHOICES = [
23
  "Cinematic Realism",
24
  "Neo-Noir Animation",
 
43
  if not spaces:
44
  return fn
45
  return spaces.GPU(duration=duration)(fn)
 
46
  return decorator
47
 
 
48
  def _character_dropdown_update(board: Storyboard | None):
49
  if not board or not board.characters:
50
  return gr.update(choices=[], value=None, interactive=False)