T5 model custom vocabulary
Is there a way to choose my custom vocabulary in T5-model while fine-tuning for a text summarization task?
I tried using a sentencepiece model to create my custom tokenizer but the model predicted some tokens which was not present in my tokenizer and hence the tokenizer takes it as an unknown token.

It is okay to add few tokens but you can not be using a totally different vocabulary and fine-tuning at the same time! The pre-trained weights are trained with the pre-trained vocabulary :) If you change the vocabulary, the trained weights become meaningless and invalid! If you want to use another vocabulary you have to train from scratch! To add tokens to vocabulary you can for example do:
tokenizer = BertTokenizer.from_pretrained(model_name)
tokenizer.add_tokens(['new', 'codekali', 'blabla'])
model = Bert.from_pretrained(model_name, return_dict=False)
     
model.resize_token_embeddings(len(tokenizer))

The last line is important because you need to tell the model that the number of tokens is changed.
