@@ -242,37 +242,43 @@ class ModelCardData(CardData):
242242 """Model Card Metadata that is used by Hugging Face Hub when included at the top of your README.md
243243
244244 Args:
245- language (`Union[str, List[str]]`, *optional*):
246- Language of model's training data or metadata. It must be an ISO 639-1, 639-2 or
247- 639-3 code (two/three letters), or a special value like "code", "multilingual". Defaults to `None`.
248- license (`str`, *optional*):
249- License of this model. Example: apache-2.0 or any license from
250- https://huggingface.co/docs/hub/repositories-licenses. Defaults to None.
251- library_name (`str`, *optional*):
252- Name of library used by this model. Example: keras or any library from
253- https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/model-libraries.ts.
254- Defaults to None.
255- tags (`List[str]`, *optional*):
256- List of tags to add to your model that can be used when filtering on the Hugging
257- Face Hub. Defaults to None.
258245 base_model (`str` or `List[str]`, *optional*):
259246 The identifier of the base model from which the model derives. This is applicable for example if your model is a
260247 fine-tune or adapter of an existing model. The value must be the ID of a model on the Hub (or a list of IDs
261248 if your model derives from multiple models). Defaults to None.
262249 datasets (`List[str]`, *optional*):
263250 List of datasets that were used to train this model. Should be a dataset ID
264251 found on https://hf.co/datasets. Defaults to None.
265- metrics (`List[str]`, *optional*):
266- List of metrics used to evaluate this model. Should be a metric name that can be found
267- at https://hf.co/metrics. Example: 'accuracy'. Defaults to None.
268252 eval_results (`Union[List[EvalResult], EvalResult]`, *optional*):
269253 List of `huggingface_hub.EvalResult` that define evaluation results of the model. If provided,
270254 `model_name` is used to as a name on PapersWithCode's leaderboards. Defaults to `None`.
255+ language (`Union[str, List[str]]`, *optional*):
256+ Language of model's training data or metadata. It must be an ISO 639-1, 639-2 or
257+ 639-3 code (two/three letters), or a special value like "code", "multilingual". Defaults to `None`.
258+ library_name (`str`, *optional*):
259+ Name of library used by this model. Example: keras or any library from
260+ https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/model-libraries.ts.
261+ Defaults to None.
262+ license (`str`, *optional*):
263+ License of this model. Example: apache-2.0 or any license from
264+ https://huggingface.co/docs/hub/repositories-licenses. Defaults to None.
265+ license_name (`str`, *optional*):
266+ Name of the license of this model. Defaults to None. To be used in conjunction with `license_link`.
267+ Common licenses (Apache-2.0, MIT, CC-BY-SA-4.0) do not need a name. In that case, use `license` instead.
268+ license_link (`str`, *optional*):
269+ Link to the license of this model. Defaults to None. To be used in conjunction with `license_name`.
270+ Common licenses (Apache-2.0, MIT, CC-BY-SA-4.0) do not need a link. In that case, use `license` instead.
271+ metrics (`List[str]`, *optional*):
272+ List of metrics used to evaluate this model. Should be a metric name that can be found
273+ at https://hf.co/metrics. Example: 'accuracy'. Defaults to None.
271274 model_name (`str`, *optional*):
272275 A name for this model. It is used along with
273276 `eval_results` to construct the `model-index` within the card's metadata. The name
274277 you supply here is what will be used on PapersWithCode's leaderboards. If None is provided
275278 then the repo name is used as a default. Defaults to None.
279+ tags (`List[str]`, *optional*):
280+ List of tags to add to your model that can be used when filtering on the Hugging
281+ Face Hub. Defaults to None.
276282 ignore_metadata_errors (`str`):
277283 If True, errors while parsing the metadata section will be ignored. Some information might be lost during
278284 the process. Use it at your own risk.
@@ -297,27 +303,33 @@ class ModelCardData(CardData):
297303 def __init__ (
298304 self ,
299305 * ,
300- language : Optional [Union [str , List [str ]]] = None ,
301- license : Optional [str ] = None ,
302- library_name : Optional [str ] = None ,
303- tags : Optional [List [str ]] = None ,
304306 base_model : Optional [Union [str , List [str ]]] = None ,
305307 datasets : Optional [List [str ]] = None ,
306- metrics : Optional [List [str ]] = None ,
307308 eval_results : Optional [List [EvalResult ]] = None ,
309+ language : Optional [Union [str , List [str ]]] = None ,
310+ library_name : Optional [str ] = None ,
311+ license : Optional [str ] = None ,
312+ license_name : Optional [str ] = None ,
313+ license_link : Optional [str ] = None ,
314+ metrics : Optional [List [str ]] = None ,
308315 model_name : Optional [str ] = None ,
316+ pipeline_tag : Optional [str ] = None ,
317+ tags : Optional [List [str ]] = None ,
309318 ignore_metadata_errors : bool = False ,
310319 ** kwargs ,
311320 ):
312- self .language = language
313- self .license = license
314- self .library_name = library_name
315- self .tags = _to_unique_list (tags )
316321 self .base_model = base_model
317322 self .datasets = datasets
318- self .metrics = metrics
319323 self .eval_results = eval_results
324+ self .language = language
325+ self .library_name = library_name
326+ self .license = license
327+ self .license_name = license_name
328+ self .license_link = license_link
329+ self .metrics = metrics
320330 self .model_name = model_name
331+ self .pipeline_tag = pipeline_tag
332+ self .tags = _to_unique_list (tags )
321333
322334 model_index = kwargs .pop ("model-index" , None )
323335 if model_index :
0 commit comments