Spaces:
Running
Running
| """ | |
| 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() | |