IW2025's picture
Upload 7 files
4b63357 verified
#!/usr/bin/env python3
"""
Launcher script for Inclusive World Curriculum Assistant
"""
import os
import sys
import subprocess
from pathlib import Path
def check_environment():
"""Check if the environment is properly set up"""
print("πŸ” Checking environment...")
# Check if required files exist
required_files = ["app.py", "config.py", "utils.py", "requirements.txt"]
missing_files = []
for file in required_files:
if not Path(file).exists():
missing_files.append(file)
if missing_files:
print(f"❌ Missing required files: {', '.join(missing_files)}")
return False
# Check if Slides directory exists
if not Path("Slides").exists():
print("⚠️ Slides directory not found. Creating...")
Path("Slides").mkdir(exist_ok=True)
print("βœ… Environment check passed")
return True
def check_dependencies():
"""Check if dependencies are installed"""
print("πŸ“¦ Checking dependencies...")
try:
import streamlit
import langchain
import chromadb
import transformers
import torch
import fitz
print("βœ… All dependencies are installed")
return True
except ImportError as e:
print(f"❌ Missing dependency: {e}")
print("Please run: pip install -r requirements.txt")
return False
def start_application():
"""Start the Streamlit application"""
print("πŸš€ Starting Inclusive World Curriculum Assistant...")
print("πŸ“– Opening web interface...")
print("🌐 The application will open in your default browser")
print("⏳ Please wait for the system to load...")
print("\n" + "="*50)
try:
# Start Streamlit
subprocess.run([
sys.executable, "-m", "streamlit", "run", "app.py",
"--server.port", "8501",
"--server.address", "localhost"
])
except KeyboardInterrupt:
print("\nπŸ‘‹ Application stopped by user")
except Exception as e:
print(f"❌ Error starting application: {e}")
def main():
"""Main launcher function"""
print("πŸŽ“ Inclusive World Curriculum Assistant")
print("=" * 50)
# Check environment
if not check_environment():
print("\n❌ Environment check failed. Please ensure all files are present.")
sys.exit(1)
# Check dependencies
if not check_dependencies():
print("\n❌ Dependencies check failed. Please install required packages.")
sys.exit(1)
# Start application
start_application()
if __name__ == "__main__":
main()