def METHOD_NAME(model_dir: str, output_dir: str | None = None):
    """convert pytorch config.json to model_config.json
    Args:
        model_dir (str): the directory of model-realted files
    """
    # 1. load the config file
    output_dir = output_dir or model_dir
    target_config_file = os.path.join(output_dir, "model_config.json")
    if os.path.exists(target_config_file):
        return
    config_file = os.path.join(model_dir, "config.json")
    assert os.path.exists(config_file), f"<config.json> not found in <{model_dir}> dir"
    with open(config_file, "r", encoding="utf-8") as f:
        config = json.load(f)
    # 2. transform the config to opt model file
    target_config = {
        "init_args": [
            {
                "intermediate_size": config["ffn_dim"],
                "attention_probs_dropout_prob": config["attention_dropout"],
                "hidden_dropout_prob": config["dropout"],
                "normalize_before": config["do_layer_norm_before"],
                "word_embed_proj_dim": config["word_embed_proj_dim"],
                "num_attention_heads": config["num_attention_heads"],
                "bos_token_id": config["bos_token_id"],
                "hidden_size": config["hidden_size"],
                "eos_token_id": config["eos_token_id"],
                "hidden_act": config["activation_function"],
                "initializer_range": config["init_std"],
                "max_position_embeddings": config["max_position_embeddings"],
                "num_hidden_layers": config["num_hidden_layers"],
                "pad_token_id": config["pad_token_id"],
                "vocab_size": config["vocab_size"],
                "init_class": "OPTModel",
            }
        ],
        "init_class": "OPTForCausalLM",
    }
    with open(target_config_file, "w", encoding="utf-8") as f:
        json.dump(target_config, f)
    print("convert config successfully ...")