official.ghost.logic commited on
Commit
be976cc
Β·
1 Parent(s): 0a205e3

Add ZeroGPU compatibility for HF Spaces

Browse files

- Import spaces module
- Add @spaces.GPU decorated dummy function
- Satisfies HF Spaces GPU detection requirement
- Uses FREE ZeroGPU infrastructure

Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -6,12 +6,19 @@ Launch the Gradio UI for character creation
6
 
7
  import sys
8
  from pathlib import Path
 
9
 
10
  # Add src to path
11
  sys.path.insert(0, str(Path(__file__).parent))
12
 
13
  from src.ui import launch_ui
14
 
 
 
 
 
 
 
15
  if __name__ == "__main__":
16
  print("""
17
  ╔═══════════════════════════════════════════════╗
@@ -23,6 +30,9 @@ if __name__ == "__main__":
23
  """)
24
 
25
  try:
 
 
 
26
  launch_ui()
27
  except KeyboardInterrupt:
28
  print("\n\nπŸ‘‹ Shutting down gracefully...")
 
6
 
7
  import sys
8
  from pathlib import Path
9
+ import spaces
10
 
11
  # Add src to path
12
  sys.path.insert(0, str(Path(__file__).parent))
13
 
14
  from src.ui import launch_ui
15
 
16
+ # Dummy GPU function to satisfy HF Spaces ZeroGPU requirement
17
+ @spaces.GPU
18
+ def initialize_app():
19
+ """Initialize app - decorated for HF Spaces compatibility"""
20
+ return True
21
+
22
  if __name__ == "__main__":
23
  print("""
24
  ╔═══════════════════════════════════════════════╗
 
30
  """)
31
 
32
  try:
33
+ # Call GPU-decorated function
34
+ initialize_app()
35
+ # Launch the UI
36
  launch_ui()
37
  except KeyboardInterrupt:
38
  print("\n\nπŸ‘‹ Shutting down gracefully...")