Skip to content

Add comprehensive tokenization tests, update diagram, and adjust code to handle edge cases #943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: lmflow-nightly
Choose a base branch
from

Conversation

Yuncong-Cao
Copy link

call stack diagram for dataset

MacBook Pro +∞ and others added 2 commits April 6, 2025 16:36
@Yuncong-Cao
Copy link
Author

call stack diagram for dataset

and tokenization

@wheresmyhair wheresmyhair dismissed a stale review April 14, 2025 01:09

not a reviewer

Copy link
Collaborator

@wheresmyhair wheresmyhair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, we need classDiagram in favor of unit tests and helping others understand call stacks better.

@Yuncong-Cao Yuncong-Cao changed the title add dataset.mmd Add comprehensive tokenization tests, update diagram, and adjust code to handle edge cases Apr 21, 2025
@Yuncong-Cao
Copy link
Author

Code changes based on tokenization tests

  1. I updated ConversationTemplate.encode_conversation to drop any unpaired final message when there’s an odd count and return only the paired turns; if the first message isn’t from the user, I skip encoding and return an empty list.
  2. I also tweaked both hf_decoder_model.py and hf_text_regression_model.py so that if a ConversationTemplate lacks a system_formatter, I set system=None before calling encode_conversation, avoiding ValueError on unformatted system prompts.

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