File size: 1,311 Bytes
71b378e
 
 
 
 
 
 
 
be976cc
71b378e
 
 
 
 
 
f0e06a6
 
 
 
 
 
 
71b378e
f0e06a6
 
 
71b378e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python3
"""
D'n'D Campaign Manager - Main Application
Launch the Gradio UI for character creation
"""

import sys
from pathlib import Path
import spaces

# Add src to path
sys.path.insert(0, str(Path(__file__).parent))

from src.ui import launch_ui

# Dummy function to satisfy HF Spaces GPU detection
# This app uses API calls (Anthropic/OpenAI/Google) so no local GPU needed
@spaces.GPU
def dummy_gpu_function():
    """Placeholder to satisfy HF Spaces ZeroGPU requirement"""
    pass

if __name__ == "__main__":
    # Call dummy GPU function to register it
    dummy_gpu_function()

    print("""
    ╔═══════════════════════════════════════════════╗
    β•‘   🎲 D'n'D Campaign Manager                   β•‘
    β•‘   Complete D&D Character Creator              β•‘
    β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

    Starting Gradio interface...
    """)

    try:
        launch_ui()
    except KeyboardInterrupt:
        print("\n\nπŸ‘‹ Shutting down gracefully...")
    except Exception as e:
        print(f"\n❌ Error: {e}")
        import traceback
        traceback.print_exc()