Skip to content
Merged
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
5 changes: 5 additions & 0 deletions bindings/python/py_src/tokenizers/tools/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ def __make_html(text: str, encoding: Encoding, annotations: AnnotationList) -> s
encoding=encoding,
)
)

# Close any remaining open annotation span
if cur_anno_ix is not None:
spans.append("</span>")

res = HTMLBody(spans) # Send the list of spans to the body of our html
return res

Expand Down
Loading