-
Notifications
You must be signed in to change notification settings - Fork 14
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
multi-threading #64
Comments
What I can think of right now is first running the preprocessing on the input string (here), then distributing pieces of the generated chunks to be tokenized to different threads, and concatenating in the end the lists of Tokens of each worker. The preprocessing is much faster than the actual tokenizing, and right now, I don't have any idea on how to split this task for concurrent threads... Does that help? |
Unfortunately we cannot achieve parallelization with multi-threading in python because og the We will be adding this multi-processing soon |
A simple way of doing it would be to change this line: https://github.com/Esukhia/botok/blob/improve-tok/botok/tokenizers/wordtokenizer.py#L80. |
The below example seems to work. The benefit is that it does not require any changes to Botok. The trick is to find the right number for I have OpenPecha repos in
|
Nice! |
Currently we're running everything on a single thread. I wonder if there is a straightforward way to provide a wrapper that allows multi-threading (or even distributing) tokenization.
The text was updated successfully, but these errors were encountered: