| language: | |
| - en | |
| license: cc-by-sa-4.0 | |
| tags: | |
| - wikipedia | |
| - bpe | |
| - cl100k_base | |
| - pre-tokenized | |
| source_datasets: | |
| - jsanzolac/ga_wikipedia | |
| # ga_wikipedia_cl100k | |
| English Wikipedia (`jsanzolac/ga_wikipedia`, dump 2023-11-01) pre-tokenized with | |
| OpenAI `tiktoken.cl100k_base`. One article per line, space-separated token ids. | |
| ## Usage | |
| ```python | |
| import gzip, tiktoken | |
| from huggingface_hub import hf_hub_download | |
| path = hf_hub_download("jsanzolac/ga_wikipedia_cl100k", "wikipedia_20231101_en.cl100k.txt.gz", repo_type="dataset") | |
| enc = tiktoken.get_encoding("cl100k_base") | |
| with gzip.open(path, "rt") as f: | |
| first = next(f).strip().split() | |
| print("First 20 ids :", first[:20]) | |
| print("Decoded :", enc.decode([int(t) for t in first[:20]])) | |