Using a fixed vocabulary?
I have a special non-language use case using a fixed vocabulary—i.e., a relatively small set of generated tokens that represent the entire vocabulary of our “language.” I’d like to be able to use this with any of the different models and I’m wondering what would be the best approach? It’s just avocab.txtfile of short strings, which I don’t think will work with any of the BPE tokenizers. Am I correct in that assumption? Also, is there a way to “force” a vocabulary onto any of the tokenizers?Any help much appreciated.
2021-10-12T00:38:51Z
What if I just instantiate a tokenizer (e.g., BigBirdTokenizer), then usedadd_tokens()to add my entire vocabulary? That is, start with nothing, then “force” them in with theadd_tokens()function… ??UPDATE: Hmm… no… I can’t instantiatewithouta vocab file, so that won’t work…
2021-11-08T16:29:10Z
In case anyone is having a similar problem (though I guess nobody is), I was able to get it loading by creating a folder withspecial_tokens_map.jsonandtokenizer_config.json, along with myvocab.txt, and passing it to therun_mlm.pyscript, using thetokenizer_nameargument.