diff --git a/sentence_transformers/model_card_template.md b/sentence_transformers/model_card_template.md index a747c55b4..5bec7cf27 100644 --- a/sentence_transformers/model_card_template.md +++ b/sentence_transformers/model_card_template.md @@ -159,8 +159,8 @@ You can finetune this model on your own dataset. {% for dataset in dataset_list %}{% if dataset_list | length > 3 %}
{{ dataset['name'] or 'Unnamed Dataset' }} {% endif %} #### {{ dataset['name'] or 'Unnamed Dataset' }} - -{% if dataset['name'] %}* Dataset: {% if 'id' in dataset %}[{{ dataset['name'] }}](https://huggingface.co/datasets/{{ dataset['id'] }}){% else %}{{ dataset['name'] }}{% endif %} +{% if dataset['name'] %} +* Dataset: {% if 'id' in dataset %}[{{ dataset['name'] }}](https://huggingface.co/datasets/{{ dataset['id'] }}){% else %}{{ dataset['name'] }}{% endif %} {%- if 'revision' in dataset and 'id' in dataset %} at [{{ dataset['revision'][:7] }}](https://huggingface.co/datasets/{{ dataset['id'] }}/tree/{{ dataset['revision'] }}){% endif %}{% endif %} {% if dataset['size'] %}* Size: {{ "{:,}".format(dataset['size']) }} {{ dataset_type }} samples {% endif %}* Columns: {% if dataset['columns'] | length == 1 %}{{ dataset['columns'][0] }}{% elif dataset['columns'] | length == 2 %}{{ dataset['columns'][0] }} and {{ dataset['columns'][1] }}{% else %}{{ dataset['columns'][:-1] | join(', ') }}, and {{ dataset['columns'][-1] }}{% endif %} diff --git a/tests/test_model_card.py b/tests/test_model_card.py index a9033799e..e86cd1462 100644 --- a/tests/test_model_card.py +++ b/tests/test_model_card.py @@ -106,3 +106,6 @@ def test_model_card_base( for substring in expected_substrings: assert substring in model_card + + # We don't want to have two consecutive empty lines anywhere + assert "\n\n\n" not in model_card