File size: 1,112 Bytes
87791cb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae898db
87791cb
 
 
 
 
 
 
 
 
 
 
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
from os import path
from loguru import logger
import sys


try:
    # Set environment variables for the app
    import os

    config_file = './app_config.yaml'
    if not path.exists(config_file):
        logger.error(
            f"Demo app configuration file '{config_file}' does not exist. "
        )
        sys.exit(1)
    else:
        logger.info(f"Using the following config file: {config_file}")
    # Set config path for the app
    os.environ["APP_CONFIG_FILE"] = config_file

    logger.info("Starting Gradio demo app...")
    # Import the demo app
    from evidence_seeker.demo_app.app import evse_demo_app

    # Launch the app
    evse_demo_app.launch(
        share=True,            # Set to True for public sharing
        debug=False,            # Set to True for development
        show_error=True         # Show detailed errors
    )

except ImportError as e:
    logger.error(f"Failed to import demo app: {e}")
    logger.error("Make sure the demo app dependencies are installed.")
    sys.exit(1)
except Exception as e:
    logger.error(f"Failed to start demo app: {e}")
    sys.exit(1)