Deploy BudgetBuddy update
Browse filesFiles changed (3)
- README.md+1-1
- app.py+15-14
- requirements.txt+4-5
3 unmodified lines456789103 unmodified linescolorFrom: indigocolorTo: greensdk: gradiosdk_version: 4.44.1app_file: app.pypinned: falseshort_description: Photograph a receipt, get editable structured data.3 unmodified lines456789103 unmodified linescolorFrom: indigocolorTo: greensdk: gradiosdk_version: 5.50.0app_file: app.pypinned: falseshort_description: Photograph a receipt, get editable structured data.
15 unmodified lines16171819202122232425262728293031323334353637383915 unmodified lines# --------------------------------------------------------------------------- ## Workaround for a Gradio 4.44 / gradio_client bug: get_api_info() crashes with# "TypeError: argument of type 'bool' is not iterable" when a component (here# gr.State holding an open dict) produces a JSON schema whose# additionalProperties is a boolean. That crash fails Gradio's startup health# check and the Space returns a 500. Patch the schema walker to tolerate bools.# --------------------------------------------------------------------------- #import gradio_client.utils as _client_utils # noqa: E402_orig_json_schema_to_python_type = _client_utils._json_schema_to_python_typedef _safe_json_schema_to_python_type(schema, defs=None):if isinstance(schema, bool):return "Any"return _orig_json_schema_to_python_type(schema, defs)_client_utils._json_schema_to_python_type = _safe_json_schema_to_python_type# --------------------------------------------------------------------------- #15 unmodified lines1617181920212223242526272829303132333435363738394015 unmodified lines# --------------------------------------------------------------------------- ## Defensive shim for an old gradio_client bug where get_api_info() crashes with# "TypeError: argument of type 'bool' is not iterable" on a boolean JSON schema# (e.g. additionalProperties: true from gr.State). Fixed in modern gradio, but# kept as a no-op-safe guard in case the internal helper is present. Wrapped in# try/except so a renamed/removed internal can never break import.# --------------------------------------------------------------------------- #try:import gradio_client.utils as _client_utils # noqa: E402_orig_json_schema_to_python_type = _client_utils._json_schema_to_python_typedef _safe_json_schema_to_python_type(schema, defs=None):if isinstance(schema, bool):return "Any"return _orig_json_schema_to_python_type(schema, defs)_client_utils._json_schema_to_python_type = _safe_json_schema_to_python_typeexcept Exception: # pragma: no cover - internal API differs; shim not neededpass# --------------------------------------------------------------------------- #
12345678910# BudgetBuddy — Phase 1 (receipt extraction with MiniCPM-V)# Gradio UIgradio==4.44.1# Gradio 4.x imports HfFolder, which huggingface_hub 1.0 removed. Pin below 1.0# so the Space's gradio build doesn't crash on import.huggingface_hub>=0.25.0,<1.0# ZeroGPU scheduler (provided on HF Spaces; harmless to install locally)spaces>=0.30.0123456789# BudgetBuddy — Phase 1 (receipt extraction with MiniCPM-V)# Gradio UI. Pinned to a modern 5.x so its transitive deps (huggingface_hub,# gradio_client, starlette/jinja2) are internally consistent with the current# ecosystem. Must match `sdk_version` in README.md.gradio==5.50.0# ZeroGPU scheduler (provided on HF Spaces; harmless to install locally)spaces>=0.30.0
README.md+1-1
app.py+15-14
requirements.txt+4-5