Spaces:
Sleeping
Sleeping
Commit History
-
🚫 Disable Content Generator Tab
Mahdi Naser Moghadasi✅ CHANGES MADE: • Commented out the entire Content Generator tab (lines 4513-4599) • Preserved all functionality for future re-enabling • All other tabs remain fully functional: - 🧮 MathMind Chatbot (with LaTeX, PDF support) - 🎯 Quiz Generator - 📚 Lesson Plan Generator 🔧 IMPLEMENTATION: • Used multi-line comment block to disable the tab • Added clear documentation for future reference • No code deletion - easy to re-enable when needed • All supporting functions remain intact 🎯 RESULT: • App now shows only: MathMind, Quiz Generator, Lesson Plans • Reduced complexity and focus on core features • Content Generator can be easily restored by uncommenting8e56f3c
-
🔧 Fix Gradio compatibility: Remove unsupported color_mode parameter, rely on CSS overrides for light mode
Mahdi Naser Moghadasi9c91697 -
🌞 Force light mode always: Disable dark mode even when users have Mac dark mode enabled
Mahdi Naser Moghadasibec2c19 -
🧠 Add intelligent document relevance checking: LLM decides if uploaded docs can answer question, mentions exact filename when using doc content
Mahdi Naser Moghadasi0b4267f -
🔓 Remove math-only restriction: Allow MathMind to answer any educational question, not just math
Mahdi Naser Moghadasi12fde5c -
📁 Simplify file management: Add multi-file upload support, remove dropdown selector, clean HTML display
Mahdi Naser Moghadasid2eb486 -
📁 Add comprehensive file management: Multiple PDF support, individual file removal, and document attribution in responses
Mahdi Naser Moghadasi35f8f30 -
🧠 Upgrade PDF validation: Use LLM intelligence instead of keywords for accurate math content detection
Mahdi Naser Moghadasi7837ea9
-
🛡️ Add safeguards: Question validation for math-only topics and enhanced PDF validation with summaries
Mahdi Naser Moghadasi8b6a701 -
✂️ Simplify MathMind welcome message: Remove verbose feature descriptions for cleaner UI
Mahdi Naser Moghadasicbedbaf -
🐛 Fix PDF upload error: Handle both file objects and bytes data properly
Mahdi Naser Moghadasi027aecf -
🔧 Fix LaTeX corruption: Simplify formatting function and improve API instructions for clean math expressions
Mahdi Naser Moghadasi2c7d8d0 -
🎉 Make MathMind super interactive: Add engaging prompts, fun facts, real-world examples, and grade-appropriate humor
Mahdi Naser Moghadasi792ede3 -
✨ Enable LaTeX rendering: Add latex_delimiters to chatbot and restore proper LaTeX formatting
Mahdi Naser Moghadasieeaf9a0 -
🔥 Remove all problematic LaTeX regex patterns - use only safe string replacements
Mahdi Naser Moghadasic86951d -
🚑 Emergency fix: Simplify LaTeX cleanup to avoid regex escape errors
Mahdi Naser Moghadasi149e3ee -
🐛 Fix regex error: Use raw strings for LaTeX replacement patterns to avoid escape sequence issues
Mahdi Naser Moghadasi5d79b13 -
🔧 Fix LaTeX rendering: Clean up malformed LaTeX patterns and improve formula display
Mahdi Naser Moghadasicf6a654 -
Enhance MathMind chatbot: Remove repetitive introductions, add age-appropriate responses, improve LaTeX rendering, and add typing effect
Mahdi Naser Moghadasiea14373 -
Fix TypeError: Fix pdf_context parameter handling in MathMind API call
Mahdi Naser Moghadasifb9b29b -
✨ Add MathMind Interactive Math Tutor Tab
Mahdi Naser Moghadasi🧮 New MathMind Features: - Interactive math chatbot with conversation memory - Age-appropriate explanations (K-2 through College) - PDF context management with math-content validation - LaTeX formula rendering support - Text-to-image generation for mathematical diagrams - Content guardrails for safe, educational responses - Step-by-step problem solving - Interactive questioning to check understanding 🔧 Technical Implementation: - PDF processing with PyPDF2 for context awareness - Math keyword validation for uploaded PDFs - Conversation history management - Integration with Hugging Face API - Custom LaTeX formatting patterns - Mathematical image generation - Content safety filters 📚 Educational Features: - Grade-level appropriate responses - Interactive teaching methodology - Visual learning with diagrams - Context-aware tutoring from PDFs - Encouragement and positive reinforcement - Fun and engaging math learningaa34ccb
-
Fix image content preservation and reduce aggressive HTML cleaning
Mahdi Naser Moghadasi- Modified fix_malformed_image_html to only remove truly malformed images - Reduced aggressive regex patterns in apply_content_styling that were removing valid image content - Preserve images with data: and http: src attributes - This should fix the content loss from 3929 to 1388 charactersc32c891 -
Fix content truncation and add dynamic token limits
Mahdi Naser Moghadasi- Add dynamic max_tokens based on content length (Short: 2000, Medium: 4000, Long: 6000) - Fix apply_content_styling function that was aggressively removing content - Add image generation debugging to track image display issues - Pass content_length parameter to API call for proper token allocation7a3654e -
Increase max_tokens to 4000 and add debugging for content truncation
Mahdi Naser Moghadasi- Increased max_tokens from 1000 to 4000 for comprehensive content generation - Added detailed debugging logs to track content length through processing pipeline - This should resolve the issue where content was being truncated from 3757 to 583 charactersf333cd1 -
Update image generation functions with improved error handling and performance
Mahdi Naser Moghadasi- Enhanced generate_image_with_huggingface with better size management - Improved generate_real_image with size checking and fallback mechanisms - Added generate_image_fallback function for styled text placeholders - Streamlined process_content_with_images with image limits - Simplified fix_malformed_image_html with better error handling9cec69e -
Fix image display by using actual base64 data instead of placeholders
Mahdi Naser Moghadasi- Restore actual img tags with base64 image data - Optimize image generation with smaller, faster models - Reduce base64 size limit to 75KB for better Gradio compatibility - Use 512x512 images with 10 inference steps for speed - Add proper image descriptions below each image - Fix the root cause: images were being converted to placeholders instead of displayedb007c47 -
Replace base64 images with beautiful placeholders
Mahdi Naser Moghadasi- Remove base64 image display that doesn't work in Gradio HTML - Create attractive gradient placeholders for generated images - Show image descriptions and generation status - Ensure consistent visual experience across all content - Focus on reliable display over complex image embeddingdee9062 -
Optimize image display for Gradio compatibility
Mahdi Naser Moghadasi- Reduce image dimensions to 256x256 for smaller base64 strings - Lower base64 size limit to 200KB for better Gradio performance - Simplify image generation to use base64 instead of file paths - Remove complex file saving logic that may cause issues - Focus on smaller, more reliable base64 images92e2845 -
Fix image HTML processing to preserve file path images
Mahdi Naser Moghadasi- Update fix_malformed_image_html function to handle file path images - Add detection for .png file paths in img src attributes - Prevent file path images from being converted to placeholders - Images should now display properly instead of showing fallback text7a273a8 -
Implement file-based image storage for better Gradio compatibility
Mahdi Naser Moghadasi- Save generated images to files instead of using base64 in HTML - Use file paths in img src instead of data URLs - Create generated_images directory for image storage - Add fallback to base64 if file saving fails - Should resolve image display issues in Gradio interfaceab01353 -
Fix image dimensions for Hugging Face API compatibility
Mahdi Naser Moghadasi- Change image dimensions from 300x300 to 288x288 (divisible by 16) - Add more model options for better fallback support - Fix API error: height and width must be divisible by 8/16 - Images should now generate successfully instead of falling back47262e1 -
Optimize image display for better Gradio compatibility
Mahdi Naser Moghadasi- Reduce image dimensions to 300x300 for smaller base64 strings - Lower base64 size limit to 500KB for better display - Improve fallback UI with gradient backgrounds and better styling - Add more robust error handling for image display issues - Optimize for Gradio HTML rendering limitations573f36e -
Add debugging for image generation and display
Mahdi Naser Moghadasi- Add detailed logging for image data length and preview - Add fallback logging when no image data is generated - Improve debugging output for HTML generation - Help diagnose base64 image display issues45b4b13 -
Fix base64 image handling and add error fallbacks
Mahdi Naser Moghadasi- Add size limit for base64 images (1MB max) - Reduce image dimensions to 400x400 to prevent large base64 strings - Add error handling for base64 encoding failures - Add fallback display when images fail to load - Improve image generation robustness1ed7f03 -
Fix image display issue and add comprehensive README
Mahdi Naser Moghadasi- Fixed malformed HTML image tags (srcdata: -> src="data:") - Enhanced fix_malformed_image_html() function with better regex patterns - Added comprehensive README.md with full documentation - Images now display properly in educational content1d24f1f -
Fix malformed image HTML generation
Mahdi Naser Moghadasi- Enhanced generate_real_image function with proper base64 validation - Added fix_malformed_image_html function to repair corrupted img tags - Improved error handling and logging for image generation - Added HTML escaping for image descriptions - Integrated HTML fixing into content processing pipeline - Fixed missing src= attribute and corrupted text in image tagsc64d3ea -
Fix image display issue - stop removing valid image tags
Mahdi Naser Moghadasi- Commented out the regex that was removing all img tags with style attributes - This was causing generated images to be stripped from the content - Images should now display properly in the UI - The issue was in apply_content_styling function line 2014b72a100 -
Add detailed debug logging for image processing
Mahdi Naser Moghadasi- Added logging to show generated HTML for each image - Added logging to show final content after image processing - This will help identify why images are generated but not displayed - Debug output will show if HTML is being generated correctly2741810 -
Add comprehensive image pattern matching and debug logging
Mahdi Naser Moghadasi- Added support for all image pattern formats including 📸 Image patterns - Added debug logging to see what patterns are actually in the content - Enhanced pattern replacement logic to handle all formats - This should fix the issue where images are generated but not displayedd63fbd5 -
Fix image generation in main app.py with working models
Mahdi Naser Moghadasi- Updated generate_image_with_huggingface function in app.py to use working models - Changed from runwayml/stable-diffusion-v1-5 (404 error) to stabilityai models - Added proper API parameters and error handling - This fixes the 404 errors seen in the logsd965642 -
Improve image generation with simplified Hugging Face API
Mahdi Naser Moghadasi- Simplified generate_image_with_huggingface() to use single reliable model - Removed complex multi-model fallback system - Uses simple educational prompts for better results - Updated generate_real_image() to use base64 data URLs - Cleaner fallback to Markdown placeholders when API fails - More reliable and faster image generation9ffab0c -
Change content output to Markdown for better rendering
Mahdi Naser Moghadasi- Changed content_output from gr.HTML() to gr.Markdown() - Removed HTML wrapper div from content styling - Converted HTML styling to Markdown-friendly format - Changed [ANSWER: text] to **Answer:** text format - Replaced HTML input elements with Markdown checkboxes (☐) - Content now renders properly in Markdown format - Improved text display and readabilityb1c7f32 -
Fix content rendering - remove interactive elements and ensure proper text display
Mahdi Naser Moghadasi- Removed all interactive elements (solve buttons, JavaScript functions) - Created generic worksheet template that works for any topic - Fixed content generation to show proper topic-specific content - Ensured clean text rendering without HTML parsing issues - Content now displays correctly for any subject (History, Science, Math, etc.) - Removed algebra-specific content and made it topic-agnostic42b257e -
Fix version markers and ensure interactive content is generated correctly
Mahdi Naser Moghadasi- Added obvious version markers (🚀🚀🚀 INTERACTIVE ALGEBRA SOLVER VERSION 2.0 🚀🚀🚀) - Fixed f-string formatting issues - Confirmed interactive functions (solveSpeed, solveVolume, etc.) are generated - Verified no basic worksheet content is being generated - Content now properly shows interactive algebra solver features436e6b3 -
Fix HTML parsing and add version markers - ready for deployment
Mahdi Naser Moghadasi370d478 -
Add obvious markers to verify deployment - Version 2.0 with Algebra Solver
Mahdi Naser Moghadasifcb8893 -
Add interactive algebra solver module and fix worksheet parsing
Mahdi Naser Moghadasi- Created comprehensive algebra_solver.py module with functions for: - Speed calculations (distance/time) - Volume calculations (mass/density) - Linear equation solving (ax + b = c) - Quadratic equation solving (h = coefficient * t²) - Answer validation with tolerance checking - Enhanced worksheet fallback content with: - Interactive input fields for all problem types - JavaScript solve functions for real-time calculation - Visual feedback with color changes on solve - Placeholder values matching worksheet examples - Fixed HTML parsing issues: - Cleaned up malformed image tags - Fixed broken button attributes - Improved regex patterns for content styling - Enhanced fallback content robustness - Integrated algebra solver into main app: - Added solver import and initialization - Created solve_algebra_problem() function - Enhanced worksheet with interactive elements - Maintained answer key hiding functionality All worksheet problems now have working s…f000309 -
Fix worksheet interactive elements and answer key visibility
Mahdi Naser Moghadasi- Add functional input fields for fill-in-the-blank answers - Add clickable rating buttons with JavaScript functionality - Add working checkboxes for self-assessment - Hide answer key in collapsible details section - Add proper styling for all interactive elements - Fix JavaScript syntax in f-string for rating buttons - Make worksheet truly interactive and student-friendly - Students can now fill in answers and rate their understanding - Answer key is hidden by default and can be revealed when needed7ac5e5e -
Revert back to original complex app structure
Mahdi Naser Moghadasi- Restore app.py to original complex version - Restore requirements.txt to original dependencies - Keep simplified versions as backup files - This reverts the Gradio Blocks refactoring958b6a1 -
Refactor to clean Gradio Blocks interface
Mahdi Naser Moghadasi- Create simplified app.py with proper Gradio Blocks structure - Use gr.HTML() to render worksheet content instead of raw text - Add clean UI with input controls and generate button - Implement proper demo.launch() for Hugging Face Spaces - Remove complex features and focus on core worksheet generation - Add LaTeX-free content generation with proper styling - Create backup of complex version as app_complex.py - Simplify requirements.txt for better compatibility - This follows the requested structure with gr.Blocks, gr.Markdown, and demo.launch()e064d7b