import json config = { "model_type": "bert", "hidden_size": 768, "num_attention_heads": 12, "num_hidden_layers": 12, "vocab_size": 30522, "max_position_embeddings": 512 } with open("config.json", "w") as f: json.dump(config, f)