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

Save tokenizer as part of model #51

Open
jonthegeek opened this issue Jan 19, 2020 · 1 comment
Open

Save tokenizer as part of model #51

jonthegeek opened this issue Jan 19, 2020 · 1 comment

Comments

@jonthegeek
Copy link
Collaborator

The tokenizer for a given model is deterministic (it only depends on the vocab file + whether it's cased). Producing the tokenizer takes 100x as long as loading a pre-processed tokenizer (about 4 s vs 40 ms for bert_base_uncased).

Save the tokenizer as part of the download process. If a model has a vocab but not a tokenizer, save a tokenizer once and then use it going forward (for backward compatibility with things that are already downloaded).

@jonthegeek
Copy link
Collaborator Author

Note: I tested preprocessing the config json vs saving it as-is, preprocessing saves microseconds, so it probably isn't worth messing with. It wouldn't HURT, though, so I may do the same fix for that one when I do the tokenizer.

@jonthegeek jonthegeek self-assigned this Nov 2, 2020
@jonthegeek jonthegeek removed their assignment Nov 7, 2023
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

No branches or pull requests

1 participant