Spaces:
Sleeping
Sleeping
Mahdi Naser Moghadasi
Fix Hugging Face Space configuration - add required YAML frontmatter to README.md
bdeb988 |
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
10.1 kB
| 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 | |
| [](https://python.org) | |
| [](https://gradio.app) | |
| [](LICENSE) | |
| 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 | |
| 1. **Clone the repository** | |
| ```bash | |
| git clone https://github.com/yourusername/brightmind-ai-clone.git | |
| cd brightmind-ai-clone | |
| ``` | |
| 2. **Install dependencies** | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| 3. **Set up environment variables (optional)** | |
| ```bash | |
| export HUGGINGFACE_TOKEN="your_hf_token_here" | |
| export SMTP_USERNAME="your_email@example.com" | |
| export SMTP_PASSWORD="your_app_password" | |
| ``` | |
| 4. **Run the application** | |
| ```bash | |
| python app.py | |
| ``` | |
| 5. **Open your browser** | |
| Navigate to `http://localhost:7860` to 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:** | |
| 1. Visit [Hugging Face](https://huggingface.co) | |
| 2. Create an account or sign in | |
| 3. Go to Settings β Access Tokens | |
| 4. Create a new token with "Read" permissions | |
| 5. Set the token as an environment variable | |
| ## π Usage Guide | |
| ### Creating Lesson Plans | |
| 1. **Enter Topic**: Describe what you want to teach (e.g., "Photosynthesis", "World War II", "Quadratic Equations") | |
| 2. **Select Subject**: Choose from the dropdown menu | |
| 3. **Choose Grade Level**: Select appropriate grade range | |
| 4. **Set Duration**: Specify lesson length (30-180 minutes) | |
| 5. **Select Difficulty**: Choose Beginner, Intermediate, or Advanced | |
| 6. **Generate**: Click the generate button and watch the AI create your lesson plan | |
| ### Creating Quizzes | |
| 1. **Enter Topic**: Specify the quiz subject | |
| 2. **Select Subject**: Choose the academic subject | |
| 3. **Choose Grade Level**: Select appropriate grade range | |
| 4. **Set Question Count**: Specify number of questions (1-20) | |
| 5. **Select Question Types**: Choose from available question formats | |
| 6. **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.0` | |
| - `stabilityai/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 conversion | |
| - `test_image_api.py`: Tests image generation functionality | |
| - `test_specific_content.py`: Tests content generation with specific parameters | |
| **Running Tests:** | |
| ```bash | |
| python test_html_rendering.py | |
| python test_image_api.py | |
| python test_specific_content.py | |
| ``` | |
| ## π Database Schema | |
| The application uses SQLite for feedback storage: | |
| ```sql | |
| 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 | |
| ```bash | |
| python app.py | |
| ``` | |
| ### Production Deployment | |
| 1. Set up environment variables | |
| 2. Install production dependencies | |
| 3. Configure reverse proxy (nginx/Apache) | |
| 4. Set up SSL certificates | |
| 5. Deploy using your preferred method (Docker, PM2, etc.) | |
| ### Docker Deployment | |
| ```dockerfile | |
| 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: | |
| 1. Fork the repository | |
| 2. Create a feature branch (`git checkout -b feature/amazing-feature`) | |
| 3. Commit your changes (`git commit -m 'Add amazing feature'`) | |
| 4. Push to the branch (`git push origin feature/amazing-feature`) | |
| 5. Open a Pull Request | |
| ### Development Setup | |
| ```bash | |
| 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](LICENSE) file for details. | |
| ## π Acknowledgments | |
| - [Gradio](https://gradio.app) for the amazing UI framework | |
| - [Hugging Face](https://huggingface.co) for providing access to state-of-the-art AI models | |
| - [Stability AI](https://stability.ai) for image generation capabilities | |
| - The educational community for inspiration and feedback | |
| ## π Support | |
| - **Issues**: [GitHub Issues](https://github.com/yourusername/brightmind-ai-clone/issues) | |
| - **Discussions**: [GitHub Discussions](https://github.com/yourusername/brightmind-ai-clone/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 |