Skip to content

Keep the last character of a vocab line that has no newline - #1321

Open
SashaMIT wants to merge 1 commit into
SWivid:mainfrom
SashaMIT:codered-vocab-last-line
Open

SashaMIT wants to merge 1 commit into
SWivid:mainfrom
SashaMIT:codered-vocab-last-line

Conversation

@SashaMIT

Copy link
Copy Markdown

Summary

get_tokenizer of a custom vocab whose last line is ni3 with no newline mapped that line to ni. The tone digit was cut off. The line now stays ni3. A file that already ends with a newline still maps ni3 to the same id. A one-character last line x stays x.

Test plan

  • python -m pytest tests/test_get_tokenizer.py
  • Red on tip: ni3 was missing, and the line was stored as ni
  • Green: ni3 is id 1, a file that ends with a newline still maps ni3, and a last line x stays x

This branch has not been deployed

No deployments
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.

1 participant