Comments (2)
I was running into a similar issue. I also wanted to model the text whitespace/formatting, without "losing" it to the pre-tokenizer.
I think I found a workaround:
tokenizer = Tokenizer(BPE())
tokenizer.pre_tokenizer = pre_tokenizers.Metaspace()
tokenizer.decoder = decoders.Metaspace()
The Metaspace
class uses a rare unicode character as a placeholder for space, which solves the json file reading issue.
from tokenizers.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
from tokenizers.
Related Issues (20)
- documentation of the `pattern` parameter in `pre_tokenizers.Split` is incorrect HOT 1
- Custom fast PreTokenizer, ported via PyO3 to Python HOT 2
- Tokenizer.from_bytes() not available in python bindings HOT 4
- BPE Split pretokenization rule is not reflected in the vocabulary HOT 2
- Truncation performs slowly. Tokenizer firstly encodes long sequence and then truncates it. HOT 2
- apply_chat_template api usage consult
- Issue with `SentencePieceUnigramTokenizer` Handling Unknown Tokens HOT 1
- `train_from_iterator` out of memory on WMT14 `de` dataset HOT 2
- return pytorch tensors like in transformers? HOT 5
- Risk of global variable memory leaks when calling train_from_iterator HOT 1
- [building on windows] onig_sys/oniguruma two or more data types in declaration specifiers HOT 2
- ValueError: The following `model_kwargs` are not used by the model: ['num_beans'] (note: typos in the generate arguments will also show up in this list)[06/Aug/2024 14:34:35] HOT 1
- Support for Golang now or support a cli for other languages? HOT 2
- Token ID Out of Range & Indexing Assertion Errors During Training HOT 4
- [test-infra] Enable Codecov for tokenizers
- `RefMutContainer` is unsound HOT 3
- Space after unnormalized token is added when `use_fast=True` for Llama tokenizer HOT 10
- Can I use SentencePieceBPETokenizer to replace google/sentencepiece? HOT 6
- .NET bindings
- BPE trainer ignoring special tokens. HOT 3
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.