[Feature]: make config.json and special_tokens_map.json optional
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.2k
- Forks
- 248
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 4
Description
What feature would you like to request?
Loading a tokenizer currently requires three files:
config.json: only used to find the pad_token_idtokenizer_config.json: used to find the pad_token (not the ID)special_tokens_map.json: used to find all special tokens.
out of these three tokenizer_config.json is the only one that's really needed. The other ones should be made optional.
pad_token_id: can be retrieved by looking up thepad_tokenin the tokenizer's vocabulary ifconfig.jsonis not presentspecial_tokens_map.json: this file is no longer written by transformers in newer versions, so it is missing for newer models. Furthermore, all special tokens can be looked up in the tokenizer itself, so they don't need to be put in this map.
So what I would advocate for is:
- Make config.json optional. Still read from it if it is present, to not break current users' expectations
- Make special_tokens_map optional. Again, still read from it, but also derive all special tokens from the tokenizer.
This way, it becomes a lot easier to add new models to fastembed.
Is there any additional information you would like to provide?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the tokenizer-loading entry point and any existing tests covering config.json, tokenizer_config.json, and special_tokens_map.json. Verify the loader still reads those files when present, works when config.json and special_tokens_map.json are absent, and derives pad_token_id and special tokens from the tokenizer where needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- huggingface, python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100