File size: 2,016 Bytes
165831c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
"""
EduTutor AI - Main Application Entry Point
Simplified main file to avoid ClamAV issues
"""

import subprocess
import sys

def install_requirements():
    """Install required packages if not available"""
    required_packages = [
        'torch', 'transformers', 'huggingface-hub', 
        'gradio', 'sympy', 'numpy'
    ]
    
    for package in required_packages:
        try:
            __import__(package)
        except ImportError:
            print(f"Installing {package}...")
            subprocess.check_call([sys.executable, "-m", "pip", "install", package])

# Install requirements before importing
install_requirements()

# Import our modular components
from core.tutor_ai import EduTutorAI
from core.features import EducationalFeatures
from interface.gradio_app import create_gradio_interface
from utils.setup import setup_environment

def main():
    """Main function to run the EduTutor AI application"""
    print("๐ŸŽ“ Starting EduTutor AI Application...")
    
    # Setup environment
    setup_environment()
    
    # Initialize components
    ai_tutor = EduTutorAI()
    features = EducationalFeatures(ai_tutor)
    
    # Load model
    model_ready = ai_tutor.load_model()
    if not model_ready:
        print("โš ๏ธ Warning: AI model failed to load. Using fallback responses.")
    
    # Create and launch interface
    print("๐ŸŒ Creating web interface...")
    gradio_app = create_gradio_interface(ai_tutor, features)
    
    print("๐Ÿš€ Launching EduTutor AI on port 7860...")
    print("๐ŸŒŸ EduTutor AI is now ready!")
    print("๐Ÿ’ก Features available:")
    print("   โ€ข ๐Ÿค– AI Chat Tutor")
    print("   โ€ข ๐Ÿ“Š Advanced Homework Analyzer") 
    print("   โ€ข ๐Ÿ“ Interactive Quizzes")
    print("   โ€ข ๐Ÿ“‹ Study Plan Generator")
    print("   โ€ข ๐Ÿ“ˆ Progress Tracking")
    
    gradio_app.launch(
        server_port=7860,
        server_name="0.0.0.0",
        share=True,
        show_error=True,
        quiet=False
    )

if __name__ == "__main__":
    main()