Comments (4)
cc @itazap that would indeed be a good addition! More and more people pre-allocate some tokens and we don't have a replace token
.
from transformers.
PS: you can already replace directly in the vocab
and the added_vocab
(since there tokens are part of both)
from transformers.
Hey @ArthurZucker,
I tried replacing a token in the vocab
(not the added_tokens) for the tokenizer.json file. But when I try to load the tokenizer back up new_tokenizer = AutoTokenizer.from_pretrained('path/to/tokenizer)
I get the following error: "Exception: data did not match any variant of untagged enum ModelWrapper at line 356367 column 3"
Do you know what the problem might be?
from transformers.
Hey @ArthurZucker,
I tried replacing a token in the
vocab
(not the added_tokens) for the tokenizer.json file. But when I try to load the tokenizer back upnew_tokenizer = AutoTokenizer.from_pretrained('path/to/tokenizer)
I get the following error: "Exception: data did not match any variant of untagged enum ModelWrapper at line 356367 column 3"Do you know what the problem might be?
You can ignore this sorry. I found the issue. if you change the vocab in anyway, you need to make sure you also update the merges accordingly.
from transformers.
Related Issues (20)
- Inconsistent special_token addition in EncoderDecoderModel forward pass
- Cannot find the best model after training HOT 1
- MPS support broken for T5 models HOT 1
- Pass `HFQuantizer` to `from_pretrained` kwargs HOT 1
- [i18n-<languageCode>] Translating docs to <languageName> HOT 1
- NumPy 2.0 support HOT 1
- Can I use "attn_implementation" in model config file HOT 3
- Encountering an error while loading a model using state_dict and quantization simultaneously HOT 6
- Fix 'Can't infer missing attention mask on `mps` device' HOT 2
- might be a waste of resources HOT 1
- Tensors' device passed to a model is not correct when ACCELERATE_TORCH_DEVICE is privateuseone
- Suport sdpa for RoBERTa and XLM-RoBERTa models
- Converting gguf fp16 & bf16 to hf is not supported. HOT 5
- Dead code, `cache_kwargs` HOT 1
- The conversion of the llama3 model back from gguf seems weird. HOT 3
- Train on logits instead of one hot vectors
- 'tf_keras' has no attribute 'activations' HOT 4
- Bug in whisper word-level timestamps (`tokenizer._decode_asr`)
- RobertaForClassification throws an error because of dimension mismatch
- Fix Bug: Gemma2 the `past_key_value.update()` function has added a new parameter "sliding_window" to support the `_sliding_update` function.
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 transformers.