Model Repos docs
The model cards are markdown files that accompany the models and provide very useful information. They are extremely important for discoverability, reproducibility and sharing! They are the
README.md file in any repo.
The model card should describe:
- the model
- its intended uses & potential limitations, including bias and ethical considerations as detailed in Mitchell, 2018
- the training params and experimental info (you can embed or link to an experiment tracking platform for reference)
- which datasets did you train on and your eval results
If needed you can find the specification here.
The model cards have a YAML section that specify metadata. These are the fields
language: "ISO 639-1 code for your language, or `multilingual`" thumbnail: "url to a thumbnail used in social sharing" tags: - tag1 - tag2 license: "any valid license identifier" datasets: - dataset1 - dataset2 metrics: - metric1 - metric2
Some useful information on them:
- All the tags can be used to filter the list of models on https://huggingface.co/models.
- License identifiers are those standardized by GitHub in the right column (keywords) here.
- Dataset, metric, and language identifiers are those listed on the Datasets, Metrics and Languages pages and in the
Here is an example:
language: - ru - en tags: - translation license: apache-2.0 datasets: - wmt19 metrics: - bleu - sacrebleu
You can specify the widget input in the model card metadata section:
widget: - text: "Jens Peter Hansen kommer fra Danmark"
We try to provide example inputs for some languages and most widget types in this DefaultWidget.ts file. If we lack some examples, please open a PR updating this file to add them. Thanks!
Yes!🔥 You can specify the framework in the model card metadata section:
tags: - flair
Find more about our supported libraries here!
You can specify the dataset in the metadata:
datasets: - wmt19
You can use the
huggingface_hub library to create, delete, update and retrieve information from repos. You can also use it to download files from repos and integrate it to your own library! For example, you can easily load a Scikit learn model with few lines.
from huggingface_hub import hf_hub_url, cached_download import joblib REPO_ID = "YOUR_REPO_ID" FILENAME = "sklearn_model.joblib" model = joblib.load(cached_download( hf_hub_url(REPO_ID, FILENAME) ))
Yes, we use the KaTeX math typesetting library to render math formulas server-side, before parsing the markdown.
You have to use the following delimiters:
$ ... $for display mode
)for inline mode (no space between the slashes and the parenthesis).
Then you'll be able to write: