File size: 871 Bytes
f8ba6bf
 
e5f75d9
f8ba6bf
 
 
e5f75d9
f8ba6bf
 
 
 
 
 
 
1dd8aa5
 
f8ba6bf
 
 
 
 
 
1dd8aa5
 
 
 
 
 
 
 
 
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
"""
DungeonMaster AI - HuggingFace Spaces Entry Point

This is the main entry point for the HuggingFace Spaces deployment.
It imports and launches the Gradio application from ui/app.py.
"""

import os
import sys

# Add the project root to the path for imports
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

# Import and run the main application
from ui.app import create_app, main, load_custom_css, CRITICAL_HEAD_CSS
from ui.themes.fantasy_theme import fantasy_theme

if __name__ == "__main__":
    main()
else:
    # For Gradio Spaces, create the app object
    demo = create_app()
    
    # Gradio 6: Load custom CSS
    custom_css = load_custom_css()
    
    # Set CSS, theme, and head directly on the app (for Gradio 6 compatibility)
    if custom_css:
        demo.css = custom_css
    demo.theme = fantasy_theme
    demo.head = CRITICAL_HEAD_CSS