# Tips for Debugging Model Cards

**URL:** <https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814>\
**Category:** 🤗Transformers\
**Created:** [August 21, 2020, 2:46pm UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814 "2020-08-21T14:46:39Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sshleifer](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sshleifer/32/3304_2.png) [@sshleifer](https://discuss.huggingface.co/u/sshleifer)\
**Post date:** [August 21, 2020, 2:46pm UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/1 "2020-08-21T14:46:39Z")

</div>

I am no expert but have learned a few things

check your yaml front matter with this tool  
[https://nodeca.github.io/js-yaml/](https://nodeca.github.io/js-yaml/)  
if it says “expected a single document in the stream, but found more”  
Your yaml is valid, otherwise your yaml is invalid.

like [this](https://nodeca.github.io/js-yaml/#yaml=LS0tCmxhbmd1YWdlOiAKLSBlbgotIHpoCnRhZ3M6Ci0gdHJhbnNsYXRpb24KbGljZW5zZTogYXBhY2hlLTIuMAotLS0KIyMjIE1hcmtkb3du) is valid

Valid:

```auto
---
language: 
- en
- zh
tags:
- translation
license: apache-2.0
---
### My fancy model

```

No spaces before tags (like “-zh”) will make this invalid.

More to come as I learn more!

Also the website takes 3 minutes for new tags to be reflected.

---

<div class="post-metadata">

**Author:** ![sshleifer](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sshleifer/32/3304_2.png) [@sshleifer](https://discuss.huggingface.co/u/sshleifer)\
**Post date:** [August 21, 2020, 2:51pm UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/2 "2020-08-21T14:51:48Z")

</div>

What tags can you add?

```auto
---
language: "ISO 639-1 code for your language, or `multilingual`"
thumbnail: "url to a thumbnail used in social sharing"
tags:
- array
- of
- tags
license: "any valid license identifier"
datasets:
- array of dataset identifiers
metrics:
- array of metric identifiers
---

```

---

<div class="post-metadata">

**Author:** ![stas](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/stas/32/19289_2.png) [@stas](https://discuss.huggingface.co/u/stas)\
**Post date:** [September 17, 2020, 7:34pm UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/3 "2020-09-17T19:34:38Z")

</div>

This template is very unintutive for someone who just does it for the first time.

I raised a bunch of questions here: [https://github.com/huggingface/transformers/issues/7208](https://github.com/huggingface/transformers/issues/7208)

I think it’d make things easier if we had:

1. a complete template that shows a very perfect entry with multiple entries where array is expected/supported
2. a document that explains each field’s format and variations.

Actually perhaps:

I think it’d make things easier if we had:

1. template with just fields and no values
2. a complete demo template that shows a very perfect entry with multiple entries where array is expected/supported
3. a document that explains each field’s format and variations.

currently the template is also an instruction document and it doesn’t work well.

---

<div class="post-metadata">

**Author:** ![stas](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/stas/32/19289_2.png) [@stas](https://discuss.huggingface.co/u/stas)\
**Post date:** [September 17, 2020, 7:36pm UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/4 "2020-09-17T19:36:58Z")

</div>

At the moment the most useful tool is a multi-line preview feature of grep. e.g. I wanted to find the format for `datasets` entry, so I did:

```auto
grep -r -A2 datasets: model_cards

```

```auto
model_cards/asafaya/bert-mini-arabic/README.md:datasets:
model_cards/asafaya/bert-mini-arabic/README.md-- oscar
model_cards/asafaya/bert-mini-arabic/README.md-- wikipedia

```

this assumes that the cards are all valid, so that you’re not copying an invalid format from an existing card.

but no urls

---

<div class="post-metadata">

**Author:** ![sshleifer](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sshleifer/32/3304_2.png) [@sshleifer](https://discuss.huggingface.co/u/sshleifer)\
**Post date:** [September 17, 2020, 7:52pm UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/5 "2020-09-17T19:52:27Z")

</div>

agreed! You could draft a template, send a PR and add julien as a reviewer.  
Then he could correct possible duckups.

---

<div class="post-metadata">

**Author:** ![stas](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/stas/32/19289_2.png) [@stas](https://discuss.huggingface.co/u/stas)\
**Post date:** [September 17, 2020, 8:47pm UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/6 "2020-09-17T20:47:19Z")

</div>

Surely it can be made better, but here is the initial attempt:

> <https://github.com/huggingface/model_card/pull/3>
>
> As discussed here: https://discuss.huggingface.co/t/tips-for-debugging-model-car…ds/814 this is a proposal which may make it easier to create model\_cards.
> 
> This PR splits the all-in-one approach which is difficult to use into 3:
> 
> 1. a template with just fields and no values
> 2. a complete demo template that shows a very perfect entry with multiple entries where array is expected/supported
> 3. a document that explains each field’s format and variations.
> 
> Surely, what I made could use more work, but this is a start.

---

<div class="post-metadata">

**Author:** ![julien-c](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/julien-c/32/41937_2.png) [@julien-c](https://discuss.huggingface.co/u/julien-c)\
**Post date:** [September 18, 2020, 7:30am UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/7 "2020-09-18T07:30:26Z")

</div>

> [@stas](#):
>
> currently the template is also an instruction document and it doesn’t work well.

I think just linking to a YAML tutorial would be enough here?

Because in my opinion the doc [here](https://huggingface.co/docs) and in [GitHub - huggingface/model\_card](https://github.com/huggingface/model_card) is pretty clear as is?

Any way, we’ll have more validation built-in to the next version of the website.

---

<div class="post-metadata">

**Author:** ![BramVanroy](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bramvanroy/32/47360_2.png) [@BramVanroy](https://discuss.huggingface.co/u/BramVanroy)\
**Post date:** [September 18, 2020, 10:01am UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/8 "2020-09-18T10:01:13Z")

</div>

Slightly off-topic: I would like to raise the case to make model cards required when submitting a model to the hub. At least some basic information such as the language. If not given it is very hard, as a user, to find the model. I would expect fo find all relevant models when I look for the Dutch tag, but not all of those models have cards and thus cannot be found this way.

Yes, it should be easy for people to upload new models but for the community’s sake it seems only fair that they also provide some information about those models.

---

<div class="post-metadata">

**Author:** ![sshleifer](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/sshleifer/32/3304_2.png) [@sshleifer](https://discuss.huggingface.co/u/sshleifer)\
**Post date:** [September 18, 2020, 1:58pm UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/9 "2020-09-18T13:58:45Z")

</div>

I think stas PR is better than current README because it shows working model cards.  
I read the README and still screwed up a number of times. It’s easy for me now to think it’s obvious but a mere 3 weeks ago it was very not obvious to me.

---

<div class="post-metadata">

**Author:** ![prajjwal1](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/prajjwal1/32/2246_2.png) [@prajjwal1](https://discuss.huggingface.co/u/prajjwal1)\
**Post date:** [September 18, 2020, 2:32pm UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/10 "2020-09-18T14:32:25Z")

</div>

I have already raised a request for a checklist here  
[https://github.com/huggingface/transformers/issues/6762](https://github.com/huggingface/transformers/issues/6762).

---

<div class="post-metadata">

**Author:** ![BramVanroy](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bramvanroy/32/47360_2.png) [@BramVanroy](https://discuss.huggingface.co/u/BramVanroy)\
**Post date:** [September 18, 2020, 3:05pm UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/11 "2020-09-18T15:05:02Z")

</div>

Love it. Wholeheartedly agree!

---

<div class="post-metadata">

**Author:** ![stas](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/stas/32/19289_2.png) [@stas](https://discuss.huggingface.co/u/stas)\
**Post date:** [September 18, 2020, 4:06pm UTC](https://discuss.huggingface.co/t/tips-for-debugging-model-cards/814/12 "2020-09-18T16:06:13Z")

</div>

> [@julien-c](#):
>
> Because in my opinion the doc [here](https://huggingface.co/docs) and in [https://github.com/huggingface/model\_card](https://github.com/huggingface/model_card) is pretty clear as is?

FWIW, I couldn’t figure it out from those 2 docs.
