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 上更新

© . This site is unofficial and not affiliated with Hugging Face, Inc.