Evaluate 文档

Hub 方法

Hugging Face's logo
加入 Hugging Face 社区

并获得增强的文档体验

开始使用

Hub 方法

用于使用 Hugging Face Hub 的方法

推送到 Hub

evaluate.push_to_hub

< >

( model_id: str task_type: str dataset_type: str dataset_name: str metric_type: str metric_name: str metric_value: float task_name: str = None dataset_config: str = None dataset_split: str = None dataset_revision: str = None dataset_args: typing.Dict[str, int] = None metric_config: str = None metric_args: typing.Dict[str, int] = None overwrite: bool = False )

参数

  • model_id (str) — 来自 https://huggingface.co/models 的模型 id。
  • task_type (str) — 任务 id,允许的值请参考 Hub 允许的任务
  • dataset_type (str) — 来自 https://huggingface.co/datasets 的数据集 id。
  • dataset_name (str) — 数据集的易读名称。
  • metric_type (str) — 来自 https://huggingface.co/metrics 的指标 id。
  • metric_name (str) — 指标的易读名称。
  • metric_value (float) — 计算出的指标值。
  • task_name (str, optional) — 任务的易读名称。
  • dataset_config (str, optional) — 在 load_dataset 中使用的数据集配置。更多信息请参阅 load_dataset
  • dataset_split (str, optional) — 用于指标计算的数据集划分名称。
  • dataset_revision (str, optional) — 数据集特定版本的 Git 哈希值。
  • dataset_args (dict[str, int], optional) — 传递给 load_dataset 的额外参数。
  • metric_config (str, optional) — 指标的配置(例如 GLUE 指标为每个子集都有一个配置)。
  • metric_args (dict[str, int], optional) — 在 compute() 期间传递的参数。
  • overwrite (bool, optional, 默认为 False) — 如果设置为 True,现有的指标字段可以被覆盖,否则尝试覆盖任何现有字段将导致错误。

将指标的结果推送到 Hub 中模型仓库的元数据。

示例

>>> 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"
... )
< > 在 GitHub 上更新