Skip to content

Conversation

@Liam-DeVoe
Copy link
Contributor

from tokenizers.tools import EncodingVisualizer, Annotation

annotations = [Annotation(start=0, end=1, label="annotation")]
# actual   hsl(10,32%,64%
# expected hsl(10,32%,64%)
EncodingVisualizer.calculate_label_colors(annotations)["annotation"]

fwiw: I found this bug during a research project I'm working on which uses LLMs to write property-based tests in Hypothesis. This property, that the hsl string should be valid, was proposed and written "autonomously" by the agent. I wrote this PR myself and take full responsibility for it.

@ArthurZucker ArthurZucker merged commit b0464b2 into huggingface:main Aug 29, 2025
@ArthurZucker
Copy link
Collaborator

Thanks 🤗

@Liam-DeVoe Liam-DeVoe deleted the calculate-label-colors branch August 30, 2025 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants