Evaluate documentation

Hub methods

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Hub methods

Methods for using the Hugging Face Hub:

Push to hub

evaluate.push_to_hub

< >

( model_id: strtask_type: strdataset_type: strdataset_name: strmetric_type: strmetric_name: strmetric_value: floattask_name: str = Nonedataset_config: str = Nonedataset_split: str = Nonedataset_revision: str = Nonedataset_args: typing.Dict[str, int] = Nonemetric_config: str = Nonemetric_args: typing.Dict[str, int] = Noneoverwrite: bool = False )

Parameters

  • model_id (str) β€” Model id from https://hf.co/models.
  • task_type (str) β€” Task id, refer to https://github.com/huggingface/evaluate/blob/main/src/evaluate/config.py#L154 for allowed values.
  • dataset_type (str) β€” Dataset id from https://hf.co/datasets.
  • dataset_name (str) β€” Pretty name for the dataset.
  • metric_type (str) β€” Metric id from https://hf.co/metrics.
  • metric_name (str) β€” Pretty name for the metric.
  • metric_value (float) β€” Computed metric value.
  • task_name (str, optional) β€” Pretty name for the task.
  • dataset_config (str, optional) β€” Dataset configuration used in datasets.load_dataset(). See huggingface/datasets docs for more info: https://huggingface.co/docs/datasets/package_reference/loading_methods#datasets.load_dataset.name
  • dataset_split (str, optional) β€” Name of split used for metric computation.
  • dataset_revision (str, optional) β€” Git hash for the specific version of the dataset.
  • dataset_args (dict[str, int], optional) β€” Additional arguments passed to datasets.load_dataset().
  • metric_config (str, optional) β€” Configuration for the metric (e.g. the GLUE metric has a configuration for each subset)
  • metric_args (dict[str, int], optional) β€” Arguments passed during Metric.compute().
  • overwrite (bool, optional, defaults to False) β€” If set to True an existing metric field can be overwritten, otherwise attempting to overwrite any existing fields will cause an error.

Pushes the result of a metric to the metadata of a model repository in the Hub.

Example:

>>> push_to_hub(
...     model_id="huggingface/gpt2-wikitext2",
...     metric_value=0.5
...     metric_type="bleu",
...     metric_name="BLEU",
...     dataset_name="WikiText",
...     dataset_type="wikitext",
...     dataset_split="test",
...     task_type="text-generation",
...     task_name="Text Generation"
... )