feat: showcase typed spans in Streamlit demo#72
Conversation
adaamko
left a comment
There was a problem hiding this comment.
Thanks — this is a careful implementation and it hits every item in #57: the fresh-clone fix, the cache-keyed model selector, per-category colors with subcategory and confidence tooltips, the legend, the per-span table, and a pure renderer with focused tests (including the right-to-left insertion-order check). I verified the full suite passes merged with current main (88 passed via both python -m pytest and python tests/run_pytest.py) and ruff is clean.
One fix needed before merge, and it's on us, not you — the issue text gave you a wrong model id: the binary v1 model on the Hub is KRLabsOrg/lettucedect-base-modernbert-en-v1 (the same lettucedect slug spelling as the v2 repos; the lettucedetect- form 404s). As written, picking "Binary spans (ModernBERT)" in the sidebar crashes on download. Please swap that one string in MODEL_OPTIONS — the issue text and docs are being fixed separately (#82).
Also please update the branch (or rebase on main): CI was recently switched to run the full test suite, and your green run predates that, so tests/test_demo_pytest.py hasn't actually been exercised by CI yet. It passes locally against current main, so this should be a formality.
Non-blocking nit: use_container_width=True on st.dataframe is deprecated in recent Streamlit (width="stretch" is the replacement); fine to leave.
Signed-off-by: w3lld1 <42353747+w3lld1@users.noreply.github.com>
c7dff4b to
95616f8
Compare
|
Thanks — fixed the binary v1 model ID to Fresh validation on
|
adaamko
left a comment
There was a problem hiding this comment.
Model id fixed and the rebase means CI now runs the demo tests under the full-suite workflow — all green. Merging; thanks for the quick turnaround and for a genuinely well-built demo upgrade.
Summary
Related issue
Fixes #57
Type of change
Testing
python3 -m ruff format --check demo/streamlit_demo.py tests/test_demo_pytest.pypython3 -m ruff check demo/streamlit_demo.py tests/test_demo_pytest.pypython3 -m pytest tests/test_demo_pytest.py -v(3 passed)python3 -m py_compile demo/streamlit_demo.py tests/test_demo_pytest.pygit diff --checkpytest tests/test_inference_pytest.py -v -k "not TestAnswerStartToken"— collection was attempted but this runner does not havetorchinstalledChecklist
Rights & sign-off (required)
distributed under the repository's MIT license
(see CONTRIBUTING).