kumarme072
kumarme072
@jacobdevlin-google I have come across many similar issues asking about how to add new tokens to a vocabulary, for reference, here are a couple links to useful comments made for...
@ArthurZucker I have come across many similar issues asking about how to add new tokens to a vocabulary, for reference, here are a couple links to useful comments made for...
```python # tokenizer.save_pretrained("model") with open("filecontainstokens.txt","r") as file: new_tokens = [line.strip() for line in file] num_added_toks = tokenizer.add_tokens(new_tokens) print('We have added', num_added_toks, 'tokens') model.resize_token_embeddings(len(tokenizer)) average_embedding = torch.mean(model.get_input_embeddings().weight, axis=0) for token_id in...
> Thanks a lot @Quppi, that was really helpful. > > I managed to get pyresparser working on python 3.10 (google collaboration notebook) and 3.11 (local laptop), by installing spacy...