Deploy BudgetBuddy update
Browse filesFiles changed (3)
- README.md+1-1
- app.py+15-14
- requirements.txt+4-5
3 unmodified lines4567789103 unmodified linescolorFrom: indigocolorTo: greensdk: gradiosdk_version: 4.44.1sdk_version: 5.50.0app_file: app.pypinned: falseshort_description: Photograph a receipt, get editable structured data.15 unmodified lines16171819202122231920212223242525262727282930313233343031323334353635363738394015 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.# 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 import gradio_client.utils as _client_utils # noqa: E402
_orig_json_schema_to_python_type = _client_utils._json_schema_to_python_type _orig_json_schema_to_python_type = _client_utils._json_schema_to_python_type
def _safe_json_schema_to_python_type(schema, defs=None): if isinstance(schema, bool): return "Any" return _orig_json_schema_to_python_type(schema, defs)
def _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 _client_utils._json_schema_to_python_type = _safe_json_schema_to_python_typeexcept Exception: # pragma: no cover - internal API differs; shim not needed pass
# --------------------------------------------------------------------------- #12345673456789# 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# 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.0README.md+1-1
app.py+15-14
requirements.txt+4-5