Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit aeac57a

Browse files
shuklak13ml-fairness-infra-github
authored andcommitted
HTML: only render dataset fields that exist.
PiperOrigin-RevId: 394280103
1 parent 3795984 commit aeac57a

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

model_card_toolkit/template/html/default_template.html.jinja

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
{% for dataset in datasets %}
2929
<div class="row">
3030
<div class="col card">
31-
<h3>{{ dataset.name }}</h3>
32-
<p>{{ dataset.description }}</p>
33-
<a href="{{ dataset.link }}">{{ dataset.link }}</a>
31+
{% if dataset.name %}<h3>{{ dataset.name }}</h3>{% endif %}
32+
{% if dataset.description %}<p>{{ dataset.description }}</p>{% endif %}
33+
{% if dataset.link %}<a href="{{ dataset.link }}">{{ dataset.link }}</a>{% endif %}
3434
{% if dataset.graphics and dataset.graphics.collection %}
3535
{{ render_graphics(dataset.graphics.collection) }}
3636
{% endif %}

model_card_toolkit/template/html/test/cats_vs_dogs.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,17 @@ <h2>Datasets</h2>
163163
<div class="row">
164164
<div class="col card">
165165
<h3>Training Set</h3>
166-
<p></p>
167-
<a href=""></a>
166+
167+
168168

169169
</div>
170170
</div>
171171

172172
<div class="row">
173173
<div class="col card">
174174
<h3>Validation Set</h3>
175-
<p></p>
176-
<a href=""></a>
175+
176+
177177

178178

179179
<div class="img-container">

model_card_toolkit/template/html/test/considerations.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ <h2>Datasets</h2>
174174
<div class="row">
175175
<div class="col card">
176176
<h3>train_split</h3>
177-
<p></p>
177+
178178
<a href="path/to/train">path/to/train</a>
179179

180180

@@ -193,7 +193,7 @@ <h3>train_split</h3>
193193
<div class="row">
194194
<div class="col card">
195195
<h3>eval_split</h3>
196-
<p></p>
196+
197197
<a href="path/to/eval">path/to/eval</a>
198198

199199

model_card_toolkit/template/html/test/train_data.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ <h2>Datasets</h2>
115115
<div class="row">
116116
<div class="col card">
117117
<h3>train_split</h3>
118-
<p></p>
118+
119119
<a href="path/to/train">path/to/train</a>
120120

121121
</div>

0 commit comments

Comments
 (0)