import os import sys import logging from dotenv import load_dotenv # Load environment variables from .env file if it exists load_dotenv() # Configure logging logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) def main(): """Run the Radar Analysis System application""" try: # Check for HF_TOKEN environment variable hf_token = os.environ.get("HF_TOKEN") if not hf_token: logger.warning("HF_TOKEN environment variable not set. The application will run in demo mode.") else: logger.info("HF_TOKEN environment variable found.") # Import app module import app # Launch the application logger.info("Starting Radar Analysis System...") app.launch() return True except Exception as e: logger.error(f"Error running application: {str(e)}") return False if __name__ == "__main__": success = main() sys.exit(0 if success else 1)