Spaces:
Sleeping
Sleeping
Commit History
2 days ago
-
Update dependencies and fix runtime bugs found in audit
Dependencies - Pin Streamlit 1.67.0 and Python 3.12 via README sdk_version/python_version - Update all packages to current releases (pandas 3.1, numpy 2.5, plotly 7.1, PyMuPDF 2.1, Pillow 13, OpenCV 5, reportlab 5.1, google-genai 3.1, firebase-admin 7.7, Document AI 3.17) - Remove unused packages: langchain, langchain-core, langchain-community, langchain-google-genai, langsmith, google-generativeai (deprecated), fpdf2, imageio, python-docx, python-dotenv, pyyaml - Add beautifulsoup4 (used for HTML table parsing) and packages.txt with tesseract-ocr so the Tesseract OCR fallback works on Spaces Streamlit API - Replace deprecated use_container_width=True with width="stretch" (136 calls) - Replace deprecated st.components.v1.html with st.iframe via embed_html helper Bug fixes - CropDrive parent-window listener script had a JS syntax error (doubled braces in a non f-string), so language/config messages were never handled - OCR: missing `io` import broke PDF-to-image conversion…3f62288
-
Simplify results analysis flow and remove streaming progress helpers
Mark CuizonDrop streamlit_runtime progress callbacks and connection-abort special-casing so analysis uses a simpler UI update path.156f38b -
Improve OCR structured parsing for soil and leaf reports
Mark CuizonRestore table/text scoring merge, SP Lab ID handling, and sliding-window alignment so structured OCR matches real lab layouts instead of shifted columns.7bf95c0 -
Use latest Gemini 3.1 Pro as default analysis model
Mark CuizonPrefer gemini-3.1-pro-preview with fallbacks to gemini-3.6-flash, gemini-3.5-flash, and gemini-2.5-pro. Map bare gemini-3.1 aliases to the full Pro endpoint and keep image/audio models blocked for text analysis.b4bd144 -
Simplify OCR structured JSON and fix results metadata display
Mark CuizonStreamline upload OCR sample formatting and structured JSON extraction. Fix seasonal datetime usage and stop filtering core step metadata fields from results UI.abdb5ed
-
Harden Gemini model selection and hide fallback error metadata
Mark Cuizon3c12ca1 -
Fix results rendering and Gemini fallback robustness
Mark Cuizon3e1ad08 -
refactor: simplify Step 2/3 results, severity thresholds, and analysis progress UI
Mark CuizonRestore simpler recommendation display and MPOB severity matching in analysis/results, and streamline Streamlit step progress updates during AI analysis.e30538d -
fix: Step 2 real issues, clean Step 1/3 formatting, stop empty re-extract
Mark CuizonKeep pre-extracted soil/leaf parameter_statistics instead of wiping them. Rebuild Step 2 from real averages with correct severity thresholds. Format Step 3 solutions as cards; strip ### and raw Action/Headers dumps; skip placeholder tables.95837b5 -
fix: analysis progress UI, Gemini models, and Step 2/3/5 results
Mark CuizonShorten AI progress labels to stop duplicating full step prompts. Prefer gemini-2.5-pro/flash. Rebuild Step 2/3/5 narratives from real issues and economic forecast when LLM returns placeholders. Route Step 2 and 5 through dedicated renderers and hide empty Issues Source dumps.f8d30ca -
fix: parse SP Lab vertical OCR layout for accurate soil structured data
Mark CuizonAdd column-major vertical Document AI parser for SP Lab reports (parameter label then one value per sample line). Fix Total P/Available P digits being skipped as column indices. Verified exact match on all 10 samples from user OCR including N.D.e400cff -
fix: structured OCR follows raw tables/text for soil and leaf
Mark CuizonPrefer header-mapped Document AI/Excel tables over shifted positional text parses. Sliding-window alignment fixes leaf N/P column shifts and soil leading junk. Flatten nested leaf Dry Matter structures; preserve SP Lab sample IDs.cf264e0 -
fix: SP Lab structured OCR pH from real raw text (transposed layout + leading junk)
Mark CuizonParse column-major SP Lab reports (samples as columns, params as rows). Align first soil value to realistic pH range so lab serial numbers are not used as pH. Prefer raw-text values over tables; never use hardcoded samples.d68f8af -
fix: parse SP Lab OCR from real text and restore Gemini analysis
Mark CuizonRemove hardcoded SP Lab sample values so structured OCR matches raw OCR (including pH). Resolve Gemini API keys from common HF secret names and use valid models with probe verification instead of gemini-3.1 fallback-only runs.5cac7b6
-
Merge hf/main: resolve conflicts, keep HF fixes and translations
Mark Cuizona5c3983 -
fix-bodystreambuffer-hf
Mark Cuizon8f155fd -
fix: restore Hugging Face Space build and startup reliability
Mark Cuizon- Remove spellchecker (no Linux wheel) and unused Streamlit extras that bloated installs - Relax pandas/numpy/PyMuPDF pins for Python 3.10 manylinux compatibility - Delete orphaned dead code in dashboard.py that could break fresh builds - Make Firebase initialization non-fatal so the Space stays running without secrets - Add safe Streamlit secrets helpers and remove import-time st.stop() in upload - Add .streamlit/config.toml and pin Python 3.10 in README metadatac9a0fae
-
Add Malay/Indonesian translation coverage and switch to Gemini 3.1
Mark Cuizonf746550
-
Fix data visualization errors in Step 1 - improve error handling and validation for bar charts
8b27ac1 -
Update app.py, results.py, and translations.py
0540f42 -
Fix Step 1 bar chart display errors - add comprehensive validation and error handling
a6cd531
-
Fix Step 6 placeholder table issue - filter out error placeholder tables
66f28c2 -
Add Palm Tree Age input (1-35 years) and Soil Type selection to upload page
ff8c766
-
Fix history page routing - handle multiple LOAD_ANALYSIS message formats and improve URL-based routing
da06b3a -
Fix LOAD_ANALYSIS message handling - inject listener globally and improve data structure processing
267453f -
Implement upload limit enforcement - block upload page access and disable buttons when limit reached
8d42b2b -
Add history page for displaying past analysis results from CropDrive website
4287aaf
-
Fix Malaysian language translations for Step 6 PDF titles and chart labels
c4a4c9c -
Update results.py
e286985 -
Update results.py
fb9e860
-
Update results, pdf_utils, and translations
329ee7f -
Fix translation for Step 6 yield forecast headers and chart titles in results page and PDF utils
412d66d -
Fix Step 6 translation issues - Translate all graph elements, axis labels, year labels, investment scenarios, and footnotes to Malaysian language
fb7fb3f -
Fix Step 2 missing formatted_analysis display in Malaysian language - Add formatted_analysis and detailed_analysis display to display_step2_issue_diagnosis function
d270421 -
Update app.py, results.py, pdf_utils.py, and translations.py
2f19080 -
Add Malaysian language translations for step results and PDF reports
- Added translate_content_labels() function to replace English labels (Analysis::, Summary::, Detailed Analysis::, Formatted Analysis::) in step results content - Applied translations to all step display functions (steps 1-6) - Translated all hardcoded English strings in PDF generation: - Header sections (Analysis Results, Analysis Date, Report Types) - Step titles and descriptions - Section headers (Summary, Detailed Analysis, Data Tables, Key Findings) - Economic Impact Forecast labels - Yield Forecast labels - Added automatic table header translation in PDF table creation - Removed blank Solution Recommendations section from Step 3 PDF - Added missing translation keys for PDF sections6d52594 -
Update results.py
ecb5e1d
-
Fix Malaysian language translations for step titles and analysis results headers
- Fixed hardcoded 'Step {number}' text to use translation function - Ensured all step titles (Step 1-6) are properly translated - Fixed 'Additional Analysis Results' header to use translation - Added translation for sub-headers: Analysis, Summary, Detailed Analysis, Formatted Analysis - Fixed 'Detailed Interpretations' headers to use translation - Added translate_llm_headers() function to translate English headers in LLM output - Applied translations to summary and detailed analysis text sectionsd934d06 -
Update results.py with additional translation fixes
f7a1772 -
Fix Malaysian language translations for step titles and analysis results headers - Translate all step titles (Step 1-6) to Malaysian - Fix STEP/LANGKAH prefix translation - Translate Additional Analysis Results header - Translate sub-headers (Analysis, Summary, Formatted Analysis, Detailed Interpretations) - Fix Economic Impact Analysis messages - Ensure all tables display properly in both languages
4217c16 -
Add Malaysian language translation for all analysis results text including step titles and headers
f099144 -
Fix: Sort nutrient gap analysis table by severity and gap magnitude
- Fix magnitude parsing to handle '%' character properly - Ensure table is sorted: Critical > Low > Balanced, then by gap magnitude descending - Update table title to use translation (Jadual 2 in Malaysian, Table 2 in English) - Remove '%' suffix from magnitude values for proper numeric sortinga4c3adb -
Fix: Improve table formatting in Step 3 and Step 6
- Convert <br> tags to proper line breaks in formatted_analysis - Extract and render markdown tables properly in Step 3 formatted analysis - Extract and render markdown tables properly in Step 6 content - Improve paragraph splitting and display formatting for better readability5ed085c -
Fix: Translate step titles and fix table placeholders in Step 5
- Added translation support for step titles (Steps 2-6) including patterns like 'Diagnose Agronomic Issues', 'Recommend Solutions', etc. - Fixed table placeholder rendering in Step 5 to replace __TABLE_PLACEHOLDER_X__ with actual economic forecast tables - Enhanced translate_step_title() function to handle more step title patterns - Updated display_formatted_economic_tables() to accept analysis_data and replace placeholders with real tables - Added Malaysian translation keys for step title patterns9de4c72
-
Fix Step 6 errors and analysis limit enforcement - Fix 'str' object has no attribute 'get' error in forecast graph - Fix interpretations and key_findings display formatting issues - Fix analysis limit check order to use updated session state - Add proper type validation for forecast data
197ef6c -
Update results.py
11a73b0 -
Update results.py with improvements and fixes
5bcdb7e -
Update results.py - code cleanup and optimizations
e38b436
-
Fix analysis history display and Step 1 table formatting - Fix Firestore timestamp to use datetime objects for proper query ordering - Add cache clearing after analysis save for immediate history display - Improve Step 1 table formatting with styled HTML tables and color-coded status
334991e
-
Fix ANALYSIS_COMPLETE message format to match integration guide - Remove userId from message (website uses authenticated user ID) - Remove timestamp from top-level message - Update local function to call integration function first - Add validation for required message fields - Fix all fallback messages to match guide format - Improve Step 1 table formatting with proper styling and descriptions
c651656