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 -
Restore robust Gemini init so analysis steps use real LLM results
Mark CuizonBlock broken gemini-3.x model IDs, prefer gemini-2.5-pro with multi-model fallback, restore google.genai client path, and switch models on 404 during generate_content so steps 1-6 no longer fall back by default.6b26e92 -
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 -
Simplify Gemini client path and prefer gemini-3.1
Mark CuizonUse the legacy google.generativeai client with a shorter model fallback list headed by gemini-3.1, and restore direct error details in fallback analysis responses.88a0782
-
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 -
chore: note gemini-2.5-pro as default analysis model
Mark Cuizon9bc4da8 -
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
-
fix: remove streamlit pin to avoid HF Spaces build conflict
Mark Cuizon9a536f5 -
chore: ignore local terminals and venv directories
Mark Cuizon3e59f08 -
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
-
Merge remote-tracking branch 'origin/main'
Mark Cuizon6924773 -
Add Malay/Indonesian translation coverage and switch to Gemini 3.1
Mark Cuizon1b7816d
-
feat: add Indonesian (Bahasa Indonesia) language support
Mark Cuizon- Add full 'id' translation dictionary to translations.py with ~300+ keys - Update get_language(), set_language(), toggle_language() to support 'id' - Toggle now cycles en -> ms -> id -> en - Add Indonesian LLM language instruction in analysis_engine.py - Update all language validations in cropdrive_integration.py to include 'id' - Update app.py fallback language checks to include 'id' - AI assistant, analysis results and PDF reports all translate to Indonesian when lang=id58ac610
-
Add Malay/Indonesian translation coverage and switch to Gemini 3.1
Mark Cuizonf746550 -
fix: update streamlit to 1.57.0 to match HF Spaces build requirement
Mark Cuizon68e976a -
fix: update streamlit to 1.57.0 to match HF Spaces build requirement
Mark Cuizon414546d
-
feat: add Indonesian (Bahasa Indonesia) language support
Mark Cuizon- Add full 'id' translation dictionary to translations.py with ~300+ keys - Update get_language(), set_language(), toggle_language() to support 'id' - Toggle now cycles en -> ms -> id -> en - Add Indonesian LLM language instruction in analysis_engine.py - Update all language validations in cropdrive_integration.py to include 'id' - Update app.py fallback language checks to include 'id' - AI assistant, analysis results and PDF reports all translate to Indonesian when lang=idb63bb45
-
Fix HF numpy dependency pin
Mark Cuizon4debe10 -
fix: resolve pip dependency conflict by removing pyrebase4
Mark Cuizon- Remove outdated pyrebase4==4.8.0 (requests-toolbelt<1.0 conflicts with langsmith>=0.4.46) - firebase-admin>=6.5.0 provides same Firebase functionality - Allows single-stage pip install without resolver conflicts - All dependencies now mutually compatible81fb39f
-
Fix data visualization errors in Step 1 - improve error handling and validation for bar charts
8b27ac1 -
Fix indentation error in app.py
c637d50 -
Update app.py and translations.py
081ba44 -
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 -
Pdf utils translated to malaysian
1c33eb3 -
Fix Step 2 missing formatted_analysis display in Malaysian language - Add formatted_analysis and detailed_analysis display to display_step2_issue_diagnosis function
d270421