Comments (6)
Thanks!
Probably because the new tokenizer does not use the normalizer / uses only a pre-tokenizer? Not super sure but thanks for sharing! 🤗
from tokenizers.
Hi, I am also having a similar issue while training a tokenizer using on Refined Web Dataset.
Similar to issue, I am using the train_from_iterator() function and training a SentencePieceBPETokenizer(), and during the Pre-processing sequences I ran out-of-memory.
I don't believe switching to another tokenizer serves my needs and, it would be great if you could provide some insights on what I can do if I want to train on large datasets.
from tokenizers.
Can you give a short script to reproduce the problem?
from tokenizers.
Sure the code below throws a out-of-memory error, process_files is the path list of arrow files downloaded from HF of RefinedWeb Dataset:
from datasets import load_dataset
data_files = {"train": process_files}
dataset = load_dataset("arrow", data_files=data_files, split="train", streaming=True)
# Build an iterator over this dataset
def batch_iterator(input_sentence_size=None, batch_size=1000):
for elem in dataset.iter(batch_size=batch_size):
yield elem["content"]
tokenizer = SentencePieceBPETokenizer()
tokenizer.train_from_iterator(
iterator=batch_iterator(),
vocab_size=30_000,
min_frequency=5,
show_progress=True,
limit_alphabet=500,
)
from tokenizers.
I just ran the script and didn't observe any OOM.
I used a 30 vCPU/240 GB AMD-Epyc server. The memory consumption increased linearly during count_pairs stage and the max was about 60%.
Caveats : I used FineWeb-Edu-10BT sample, saved as parquet files instead of arrow.
Hope that helps.
from tokenizers.
There is an ongoing PR for arrow support, if that helps we should def merge it!
from tokenizers.
Related Issues (20)
- How to write custom Wordpiece class? HOT 3
- Link to download the training text in `docs/source/quicktour.rst` is broken HOT 5
- Strange warnings with tokenizer for some models HOT 5
- Bug with `CodeQwen1.5`: `data did not match any variant of untagged enum PyPreTokenizerTypeWrapper` HOT 1
- Converting `tokenizers` tokenizers into `tiktoken` tokenizers HOT 5
- How to Batch-Encode Paired Input Sentences with Tokenizers: Seeking Clarification HOT 1
- How to allow the merging of consecutive newline tokens \n when training a byte-level bpe tokenizer? HOT 3
- [BUG]Might be a bug in Unigram Trainer HOT 1
- Training HuggingFace tokenizer - ignore_merges HOT 2
- Memory leak for large strings HOT 8
- Deserializing BPE tokenizer failure HOT 4
- llama3 tokenizer doesn't round trip HOT 4
- [BUG] Fast tokenizer does not deal with AddedTokens properly(no problem in Transformers python tokenizer impl.) HOT 6
- How can I get the mapping relationship between byte values and Unicode characters of the fast tokenizer? HOT 5
- How to use `TokenizerBuilder`? HOT 4
- [Bug?] Modifying normalizer for pretrained tokenizers don't consistently work HOT 2
- Llama-3 offset-mapping needs fixing HOT 5
- `Encoding` object stub doesn't include `__len__` HOT 2
- Progress bar doesn't show in log file. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tokenizers.