Skip to content

Commit d914261

Browse files
elishowkosanseviero
andauthored
Proposal : improve docs about metadata validation (#342)
* improve docs about metadata validation * Update docs/hub/adding-a-library.md Co-authored-by: Omar Sanseviero <[email protected]> Co-authored-by: Omar Sanseviero <[email protected]>
1 parent 66f869f commit d914261

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

docs/hub/adding-a-library.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,37 +253,41 @@ The full model card specification is [here](https://github.com/huggingface/hugg
253253
language:
254254
- {lang_0} # Example: fr
255255
- {lang_1} # Example: en
256-
license: {license} # Example: apache-2.0
256+
license: {license} # Example: apache-2.0 or any license from https://hf.co/docs/hub/model-repos#list-of-license-identifiers
257257
tags:
258258
- {tag_0} # Example: audio
259259
- {tag_1} # Example: automatic-speech-recognition
260260
- {tag_2} # Example: speech
261261
- {tag_3} # Example to specify a library: allennlp
262262
datasets:
263-
- {dataset_0} # Example: common_voice
263+
- {dataset_0} # Example: common_voice. Use dataset id from https://hf.co/datasets
264264
metrics:
265-
- {metric_0} # Example: wer
265+
- {metric_0} # Example: wer. Use metric id from https://hf.co/metrics
266266

267-
model-index:
267+
# Optional. Add this if you want to encode your eval results in a structured way.
268+
model-index:
268269
- name: {model_id}
269270
results:
270271
- task:
271-
name: {task_name} # Example: Speech Recognition
272-
type: {task_type} # Example: automatic-speech-recognition
272+
type: {task_type} # Required. Example: automatic-speech-recognition
273+
name: {task_name} # Optional. Example: Speech Recognition
273274
dataset:
274-
name: {dataset_name} # Example: Common Voice zh-CN
275-
type: {dataset_type} # Example: common_voice
276-
args: {arg_0} # Example: zh-CN
275+
type: {dataset_type} # Required. Example: common_voice. Use dataset id from https://hf.co/datasets
276+
name: {dataset_name} # Required. Example: Common Voice zh-CN
277+
args: {arg_0} # Optional. Example: zh-CN
277278
metrics:
278-
- name: {metric_name} # Example: Test WER
279-
type: {metric_type} # Example: wer
280-
value: {metric_value} # Example: 20.90
281-
args: {arg_0} # Example for BLEU: max_order
279+
- type: {metric_type} # Required. Example: wer
280+
value: {metric_value} # Required. Example: 20.90
281+
name: {metric_name} # Optional. Example: Test WER
282+
args: {arg_0} # Optional. Example for BLEU: max_order
282283
---
283284
```
284285

285286
None of the fields are required - but any added field will improve the discoverability of your model and open it to features such as the inference API. You can find more information on repos and model cards [here](/docs/hub/model-repos#model-card-metadata).
286287

288+
When present, and only then, 'model-index', 'datasets' and 'license' contents will be verified when git pushing changes to your README.me file.
289+
Valid license identifiers can be found in [our docs](/docs/hub/model-repos#list-of-license-identifiers)
290+
287291
## Setting up the Inference API
288292

289293
### Docker image

modelcard.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
language:
33
- {lang_0} # Example: fr
44
- {lang_1} # Example: en
5-
license: {license} # Example: apache-2.0
5+
license: {license} # Example: apache-2.0 or any license from https://huggingface.co/docs/hub/model-repos#list-of-license-identifiers
66
tags:
77
- {tag_0} # Example: audio
88
- {tag_1} # Example: automatic-speech-recognition
@@ -31,4 +31,6 @@ model-index:
3131
args: {arg_0} # Optional. Example for BLEU: max_order
3232
---
3333

34-
This markdown file contains the spec for the modelcard metadata regarding evaluation parameters.
34+
This markdown file contains the spec for the modelcard metadata regarding evaluation parameters.
35+
When present, and only then, 'model-index', 'datasets' and 'license' contents will be verified when git pushing changes to your README.me file.
36+
Valid license identifiers can be found in [our docs](https://huggingface.co/docs/hub/model-repos#list-of-license-identifiers)

0 commit comments

Comments
 (0)