my_config = DistilBertConfig(activation="relu", attention_dropout=0.4) | |
print(my_config) | |
DistilBertConfig { | |
"activation": "relu", | |
"attention_dropout": 0.4, | |
"dim": 768, | |
"dropout": 0.1, | |
"hidden_dim": 3072, | |
"initializer_range": 0.02, | |
"max_position_embeddings": 512, | |
"model_type": "distilbert", | |
"n_heads": 12, | |
"n_layers": 6, | |
"pad_token_id": 0, | |
"qa_dropout": 0.1, | |
"seq_classif_dropout": 0.2, | |
"sinusoidal_pos_embds": false, | |
"transformers_version": "4.16.2", | |
"vocab_size": 30522 | |
} | |
Pretrained model attributes can be modified in the [~PretrainedConfig.from_pretrained] function: | |
my_config = DistilBertConfig.from_pretrained("distilbert/distilbert-base-uncased", activation="relu", attention_dropout=0.4) | |
Once you are satisfied with your model configuration, you can save it with [~PretrainedConfig.save_pretrained]. |