diff --git a/notebooks/07_final_report.ipynb b/notebooks/07_final_report.ipynb index d46b53d..d78fe45 100644 --- a/notebooks/07_final_report.ipynb +++ b/notebooks/07_final_report.ipynb @@ -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)" ] } ], diff --git a/scripts/run_demo.py b/scripts/run_demo.py index 2e58cab..a05bce5 100644 --- a/scripts/run_demo.py +++ b/scripts/run_demo.py @@ -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: @@ -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__":