Skip to content
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

Tokenizer in C #15

Closed
wants to merge 2 commits into from
Closed

Conversation

python273
Copy link
Contributor

Very simple. It doesn't remove leading spaces. Might be good idea to test with weird unicode?

Screenshot 2023-07-24 at 01 06 16

@karpathy
Copy link
Owner

Very interesting!! Will take a look tonight thank you!

@python273
Copy link
Contributor Author

Looks like #12 also has tokenizer implementation 😅

@karpathy
Copy link
Owner

@python273 do you understand where #12 gets the vocab.bin file from? presumably a similar export script?

t = '\n<s>\n'
elif i == eos_id:
t = '\n</s>\n'
elif len(t) == 6 and t.startswith('<0x') and t.endswith('>'):
Copy link
Owner

Choose a reason for hiding this comment

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

??? some comments around here could be nice. i haven't dug into sp too much but this looks odd

@karpathy
Copy link
Owner

@python273 I got it working. What are the leading spaces? How does SentencePiece handles this 🤔

@karpathy
Copy link
Owner

Solved here I think.
3bfa566

ty!!

@karpathy karpathy closed this Jul 24, 2023
@karpathy
Copy link
Owner

(I didn't solve the leading space issue... leaving it there for now, will look later into what sentencepeice does with this)

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