Mohammad Khodadad
Results
1
comments of
Mohammad Khodadad
@sandeep-krutrim You can access the weights of an embedding layer through embeddings.weight.data. So you can do something like: ` old_embeddings=model.bert.embeddings.word_embeddings new_embeddings=nn.Embedding(new_num_tokens,emb_dim) new_embeddings.weight.data[:old_num_tokens] = old_embeddings.weight.data model.bert.embeddings.word_embeddings=new_embeddings ` You can also tie_weights()...