Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions notebooks/07_final_report.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,12 @@
"f = summary.get('funsd', {})\n",
"if f.get('available'):\n",
" h = f['headline']\n",
" print(f\"\n",
"FUNSD headline ({f['primary']}): \"\n",
" f\"P {h['precision']:.3f} / R {h['recall']:.3f} / F1 {h['f1']:.3f}\")"
" headline = (\n",
" f\"FUNSD headline ({f['primary']}): \"\n",
" f\"P {h['precision']:.3f} / R {h['recall']:.3f} / F1 {h['f1']:.3f}\"\n",
" )\n",
" print()\n",
" print(headline)"
]
}
],
Expand Down
10 changes: 9 additions & 1 deletion scripts/run_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ def layout_view(page_id: str):
# --- FUNSD + Overview + Limitations ---


def gradio_allowed_paths() -> list[str]:
"""Artifact paths Gradio may serve when outputs live outside the repo, e.g. Colab Drive."""
paths = [
config.LAYOUT_OUTPUT / "crops",
]
return [str(p.resolve()) for p in paths if p.exists()]


def funsd_view() -> str:
d = _load_json(config.EVALUATION / "phase3_funsd_relations.json")
if d is None:
Expand Down Expand Up @@ -319,7 +327,7 @@ def main() -> None:
with gr.Tab("Limitations"):
gr.Markdown(LIMITATIONS_MD)

demo.launch(share=config.IN_COLAB)
demo.launch(share=config.IN_COLAB, allowed_paths=gradio_allowed_paths())


if __name__ == "__main__":
Expand Down
Loading