Spaces:
Sleeping
Download README.md from brightmind-ai/test: direct link, hf CLI and curl.
- Browser
- Download file 10.1 kB
-
https://huggingface.co/spaces/brightmind-ai/test/resolve/main/README.md
- Command line
-
hf download hf://spaces/brightmind-ai/test/README.md
-
curl -L -o README.md https://huggingface.co/spaces/brightmind-ai/test/resolve/main/README.md
A newer version of the Gradio SDK is available: 6.32.0
title: BrightMind AI - Educational Content Generator
emoji: π§
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.1
app_file: app.py
pinned: false
license: mit
short_description: AI-powered educational content generation platform
π§ BrightMind AI - Educational Content Generator
An intelligent educational platform that generates comprehensive lesson plans, quizzes, and educational content using AI and proven educational algorithms. BrightMind AI empowers educators with intelligent tools to create engaging, grade-appropriate content across all subjects.
β¨ Features
π€ AI-Powered Content Generation
- Hugging Face Integration: Uses state-of-the-art language models for enhanced content creation
- Intelligent Fallback: Educational algorithms ensure content generation even without API access
- Context-Aware: Adapts content based on subject, grade level, and difficulty
π Educational Content Types
- Lesson Plans: Comprehensive, structured lesson plans with objectives, activities, and assessments
- Quizzes: Custom quizzes with multiple question types (Multiple Choice, True/False, Short Answer, Fill-in-the-Blank)
- Worksheets: Interactive educational materials with visual elements
- Study Guides: Structured study materials for various subjects
π― Grade-Appropriate Content
- K-2: Early elementary content with visual aids and simple concepts
- 3-5: Upper elementary with hands-on activities
- 6-8: Middle school with analytical thinking
- 9-12: High school with advanced concepts and critical thinking
π Subject Coverage
- Science: Biology, Chemistry, Physics, Earth Science
- Mathematics: Algebra, Geometry, Statistics, Calculus
- History: World History, US History, Ancient Civilizations
- English: Literature, Writing, Grammar, Reading Comprehension
- Geography: Physical and Human Geography
- Art: Art History, Techniques, Creative Projects
π¨ Advanced Features
- Image Generation: AI-powered educational illustrations using Hugging Face models
- Math Rendering: LaTeX to HTML conversion for mathematical expressions
- Progress Tracking: Real-time generation progress with visual feedback
- Feedback System: Built-in feedback collection and database storage
- Responsive UI: Modern, intuitive interface built with Gradio
π Quick Start
Prerequisites
- Python 3.8 or higher
- pip package manager
Installation
Clone the repository
git clone https://github.com/yourusername/brightmind-ai-clone.git cd brightmind-ai-cloneInstall dependencies
pip install -r requirements.txtSet up environment variables (optional)
export HUGGINGFACE_TOKEN="your_hf_token_here" export SMTP_USERNAME="your_email@example.com" export SMTP_PASSWORD="your_app_password"Run the application
python app.pyOpen your browser Navigate to
http://localhost:7860to access the application
π§ Configuration
Environment Variables
| Variable | Description | Required | Default |
|---|---|---|---|
HUGGINGFACE_TOKEN |
Hugging Face API token for AI content generation | No | None |
SMTP_USERNAME |
Email username for feedback notifications | No | "" |
SMTP_PASSWORD |
Email password for feedback notifications | No | "" |
API Configuration
The application automatically detects your Hugging Face token and uses it for enhanced content generation. Without a token, the app falls back to educational algorithms.
Getting a Hugging Face Token:
- Visit Hugging Face
- Create an account or sign in
- Go to Settings β Access Tokens
- Create a new token with "Read" permissions
- Set the token as an environment variable
π Usage Guide
Creating Lesson Plans
- Enter Topic: Describe what you want to teach (e.g., "Photosynthesis", "World War II", "Quadratic Equations")
- Select Subject: Choose from the dropdown menu
- Choose Grade Level: Select appropriate grade range
- Set Duration: Specify lesson length (30-180 minutes)
- Select Difficulty: Choose Beginner, Intermediate, or Advanced
- Generate: Click the generate button and watch the AI create your lesson plan
Creating Quizzes
- Enter Topic: Specify the quiz subject
- Select Subject: Choose the academic subject
- Choose Grade Level: Select appropriate grade range
- Set Question Count: Specify number of questions (1-20)
- Select Question Types: Choose from available question formats
- Generate: Create your custom quiz
Content Types Available
- Lesson Plans: Complete structured lessons with objectives, activities, materials, and assessments
- Quizzes: Interactive assessments with multiple question types
- Worksheets: Practice materials and exercises
- Study Guides: Comprehensive review materials
ποΈ Project Structure
brightmind-ai-clone/
βββ app.py # Main application file
βββ config.py # Configuration and environment variables
βββ ai_services.py # AI/ML functionality and API calls
βββ content_generators.py # Content generation logic
βββ database.py # Database operations and feedback storage
βββ email_service.py # Email notification system
βββ ui_components.py # UI components and styling
βββ utils.py # Utility functions and helpers
βββ algebra_solver.py # Mathematical problem solving
βββ requirements.txt # Python dependencies
βββ requirements_simple.txt # Minimal dependencies
βββ requirements_complex.txt # Full feature dependencies
βββ generated_images/ # AI-generated educational images
βββ icons/ # Application icons and assets
βββ test_*.py # Test files for various components
βββ README.md # This documentation
π API Integration
Hugging Face Models
The application uses several Hugging Face models:
- Content Generation:
deepseek-ai/DeepSeek-V3-0324 - Image Generation:
stabilityai/stable-diffusion-xl-base-1.0stabilityai/stable-diffusion-3-medium-diffusers
API Endpoints
- Content Generation:
https://router.huggingface.co/v1/chat/completions - Image Generation:
https://api-inference.huggingface.co/models/{model_name}
π§ͺ Testing
The project includes comprehensive test files:
test_html_rendering.py: Tests HTML rendering and LaTeX conversiontest_image_api.py: Tests image generation functionalitytest_specific_content.py: Tests content generation with specific parameters
Running Tests:
python test_html_rendering.py
python test_image_api.py
python test_specific_content.py
π Database Schema
The application uses SQLite for feedback storage:
CREATE TABLE feedback (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp TEXT NOT NULL,
feedback_type TEXT NOT NULL,
rating INTEGER NOT NULL,
comments TEXT NOT NULL,
user_email TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
π¨ Customization
UI Themes
The application uses Gradio's Soft theme by default. You can customize the theme by modifying the gr.themes.Soft() parameter in app.py.
Content Styling
Educational content is styled with custom CSS for better readability and visual appeal. Styles are defined in the ui_components.py file.
Image Generation
Customize image generation by modifying prompts in ai_services.py or adding new image sources in the fallback system.
π Deployment
Local Development
python app.py
Production Deployment
- Set up environment variables
- Install production dependencies
- Configure reverse proxy (nginx/Apache)
- Set up SSL certificates
- Deploy using your preferred method (Docker, PM2, etc.)
Docker Deployment
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 7860
CMD ["python", "app.py"]
π€ Contributing
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Setup
git clone https://github.com/yourusername/brightmind-ai-clone.git
cd brightmind-ai-clone
pip install -r requirements.txt
python app.py
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Gradio for the amazing UI framework
- Hugging Face for providing access to state-of-the-art AI models
- Stability AI for image generation capabilities
- The educational community for inspiration and feedback
π Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: mahdi@brightmind-ai.com
π Changelog
Version 1.0.0
- Initial release with AI-powered content generation
- Support for lesson plans and quizzes
- Hugging Face API integration
- Image generation capabilities
- Feedback system with database storage
- Responsive UI with Gradio
BrightMind AI - Empowering educators with intelligent tools π§ β¨
Last Updated: September 2024