def _create_model_card(repo_dir: Path):
    """Creates a model card for the repository.

    TODO: Add metrics to model-index
    TODO: Use information from common model cards
    """
    readme_path = repo_dir / "README.md"
    prev_readme = ""
    if readme_path.exists():
        with readme_path.open("r", encoding="utf8") as f:
            prev_readme = f.read()
    with readme_path.open("w", encoding="utf-8") as f:
        f.write(README_TEMPLATE)
        f.write(prev_readme)
Creates a model card for the repository.

TODO: Add metrics to model-index
TODO: Use information from common model cards
allennlp/common/push_to_hf.py