+
    QV-j¾  ã                   óX   € R t ^ RIHt ^ RIHt ] ! R R4      4       tR R ltR R ltR	# )
zíEvaluation results utilities for the `.eval_results/*.yaml` format.

See https://huggingface.co/docs/hub/eval-results for more details.
Specifications are available at https://github.com/huggingface/hub-docs/blob/main/eval_results.yaml.
)Ú	dataclass)ÚAnyc                   ób   a € ] tR t^t o RtRtRtRtRtRt	Rt
RtRtV 3R lR ltV 3R ltRtV tR# )ÚEvalResultEntryaL	  
Evaluation result entry for the `.eval_results/*.yaml` format.

Represents evaluation scores stored in model repos that automatically appear on
the model page and the benchmark dataset's leaderboard.

For the legacy `model-index` format in `README.md`, use [`EvalResult`] instead.

See https://huggingface.co/docs/hub/eval-results for more details.

Args:
    dataset_id (`str`):
        Benchmark dataset ID from the Hub. Example: "cais/hle", "Idavidrein/gpqa".
    task_id (`str`):
        Task identifier within the benchmark. Example: "gpqa_diamond".
    value (`Any`):
        The metric value. Example: 20.90.
    dataset_revision (`str`, *optional*):
        Git SHA of the benchmark dataset.
    verify_token (`str`, *optional*):
        A signature that can be used to prove that evaluation is provably auditable and reproducible.
    date (`str`, *optional*):
        When the evaluation was run (ISO-8601 datetime). Defaults to git commit time.
    source_url (`str`, *optional*):
        Link to the evaluation source (e.g., https://huggingface.co/spaces/SaylorTwift/smollm3-mmlu-pro). Required if `source_name`, `source_user`, or `source_org` is provided.
    source_name (`str`, *optional*):
        Display name for the source. Example: "Eval Logs".
    source_user (`str`, *optional*):
        HF user name for attribution. Example: "celinah".
    source_org (`str`, *optional*):
        HF org name for attribution. Example: "cais".
    notes (`str`, *optional*):
        Details about the evaluation setup. Example: "tools", "no-tools", "chain-of-thought".

Example:
    ```python
    >>> from huggingface_hub import EvalResultEntry
    >>> # Minimal example with required fields only
    >>> result = EvalResultEntry(
    ...     dataset_id="Idavidrein/gpqa",
    ...     task_id="gpqa_diamond",
    ...     value=0.412,
    ... )
    >>> # Full example with all fields
    >>> result = EvalResultEntry(
    ...     dataset_id="cais/hle",
    ...     task_id="default",
    ...     value=20.90,
    ...     dataset_revision="5503434ddd753f426f4b38109466949a1217c2bb",
    ...     verify_token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    ...     date="2025-01-15T10:30:00Z",
    ...     source_url="https://huggingface.co/datasets/cais/hle",
    ...     source_name="CAIS HLE",
    ...     source_org="cais",
    ...     notes="no-tools",
    ... )

    ```
Nc                ó   <€ V ^8„  d   QhRR/# )é   ÚreturnN© )ÚformatÚ__classdict__s   "€Ún/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/huggingface_hub/_eval_results.pyÚ__annotate__ÚEvalResultEntry.__annotate__U   s   ø€ ÷ ñ ˜tñ ó    c                ó�   € V P                   f   V P                  f   V P                  e   V P                  f   \	        R4      hR # R # )NzaIf `source_name`, `source_user`, or `source_org` is provided, `source_url` must also be provided.)Úsource_nameÚsource_userÚ
source_orgÚ
source_urlÚ
ValueError)Úselfs   &r   Ú__post_init__ÚEvalResultEntry.__post_init__U   sH   € à×ÑÒ(¨D×,<Ñ,<Ò,HÈDÏOÉOÒLgØ�o‰oÒ%ÜØsóð ñ &ñ Mhr   c                ó  <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   S[;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R	&   S[ R,          ;R
&   S[ R,          ;R&   S[ R,          ;R&   # )r   Ú
dataset_idÚtask_idÚvalueNÚdataset_revisionÚverify_tokenÚdater   r   r   r   Únotes)Ústrr   )r
   r   s   "€r   r   r      sÇ   ø‡ ‚ ñ| �Oñ} ñ~ �Lñ ñ@ �JñA ñB ˜D•jÑ'ñC ñD ˜•*Ñ#ñE ñF ��*ÑñG ñH �d•
Ñ!ñI ñJ �t•Ñ"ñK ñL �t•Ñ"ñM ñN �d•
Ñ!ñO ñP ��:ÑòQ r   r	   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r   r   r   r   r    r   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      sH   ø‡ € ñ:ð~ $(ÐØ#€LØ€DØ!€JØ"€KØ"€KØ!€JØ€E÷ð ÷U ƒ r   r   c                ó~   € V ^8„  d   QhR\         \        ,          R\         \        \        \        3,          ,          /# )r   Úentriesr   )Úlistr   Údictr!   r   )r
   s   "r   r   r   ^   s1   € ÷ Cñ C¬¬oÕ)>ð CÄ4ÌÌSÔRUÈXÍÕCWñ Cr   c                ól  € . pV  EF*  pRVP                   RVP                  /pVP                  e   VP                  VR&   RVRVP                  /pVP                  e   VP                  VR&   VP
                  e   VP
                  VR&   VP                  ej   RVP                  /pVP                  e   VP                  VR	&   VP                  e   VP                  VR
&   VP                  e   VP                  VR&   WTR&   VP                  e   VP                  VR&   VP                  V4       EK-  	  V# )aQ  Convert a list of [`EvalResultEntry`] objects to a YAML-serializable list of dicts.

This produces the format expected in `.eval_results/*.yaml` files.

Args:
    entries (`list[EvalResultEntry]`):
        List of evaluation result entries to serialize.

Returns:
    `list[dict[str, Any]]`: A list of dictionaries ready to be dumped to YAML.

Example:
    ```python
    >>> from huggingface_hub import EvalResultEntry, eval_result_entries_to_yaml
    >>> entries = [
    ...     EvalResultEntry(dataset_id="cais/hle", task_id="default", value=20.90),
    ...     EvalResultEntry(dataset_id="Idavidrein/gpqa", task_id="gpqa_diamond", value=0.412),
    ... ]
    >>> yaml_data = eval_result_entries_to_yaml(entries)
    >>> yaml_data[0]
    {'dataset': {'id': 'cais/hle', 'task_id': 'default'}, 'value': 20.9}

    ```

    To upload eval results to the Hub:
    ```python
    >>> import yaml
    >>> from huggingface_hub import upload_file, EvalResultEntry, eval_result_entries_to_yaml
    >>> entries = [
    ...     EvalResultEntry(dataset_id="cais/hle", task_id="default", value=20.90),
    ... ]
    >>> yaml_content = yaml.dump(eval_result_entries_to_yaml(entries))
    >>> upload_file(
    ...     path_or_fileobj=yaml_content.encode(),
    ...     path_in_repo=".eval_results/hle.yaml",
    ...     repo_id="your-username/your-model",
    ... )

    ```
Úidr   ÚrevisionÚdatasetr   ÚverifyTokenr   ÚurlÚnameÚuserÚorgÚsourcer    )r   r   r   r   r   r   r   r   r   r   r    Úappend)r+   ÚresultÚentryr1   Údatar7   s   &     r   Úeval_result_entries_to_yamlr<   ^   s+  € ðR €FÜˆà#'¨×)9Ñ)9¸9ÀeÇmÁmÐ"TˆØ×!Ñ!Ò-Ø"'×"8Ñ"8ˆG�JÑà )¨7°G¸U¿[¹[ÐIˆØ×ÑÒ)Ø"'×"4Ñ"4ˆD�ÑØ�:‰:Ò!Ø Ÿ:™:ˆD�‰Là×ÑÒ'Ø&+¨U×-=Ñ-=Ð%>ˆFØ× Ñ Ò,Ø!&×!2Ñ!2��v‘Ø× Ñ Ò,Ø!&×!2Ñ!2��v‘Ø×ÑÒ+Ø %× 0Ñ 0��u‘Ø#�‰NØ�;‰;Ò"Ø!ŸK™KˆD�‰Mà�‰�d×ñ1 ð2 €Mr   c                ó~   € V ^8„  d   QhR\         \        \        \        3,          ,          R\         \        ,          /# )r   r;   r   )r,   r-   r!   r   r   )r
   s   "r   r   r   ¤   s,   € ÷ /ñ /¤D¬¬c´3¨h­Õ$8ð /¼TÄ/Õ=Rñ /r   c                óD  € . pV  EF  pVP                  RV4      pVP                  R/ 4      pVP                  R/ 4      p\        VR,          VR,          VR,          VP                  R4      VP                  R4      VP                  R	4      V'       d   VP                  R
4      MRV'       d   VP                  R4      MRV'       d   VP                  R4      MRV'       d   VP                  R4      MRVP                  R4      R7      pVP                  V4       EK  	  V# )a,  Parse a list of dicts into [`EvalResultEntry`] objects.

This parses the `.eval_results/*.yaml` format. For the legacy `model-index` format,
use [`model_index_to_eval_results`] instead.

Args:
    data (`list[dict[str, Any]]`):
        A list of dictionaries (e.g., parsed from YAML or API response).

Returns:
    `list[EvalResultEntry]`: A list of evaluation result entry objects.

Example:
    ```python
    >>> from huggingface_hub import parse_eval_result_entries
    >>> data = [
    ...     {"dataset": {"id": "cais/hle", "task_id": "default"}, "value": 20.90},
    ...     {"dataset": {"id": "Idavidrein/gpqa", "task_id": "gpqa_diamond"}, "value": 0.412},
    ... ]
    >>> entries = parse_eval_result_entries(data)
    >>> entries[0].dataset_id
    'cais/hle'
    >>> entries[0].value
    20.9

    ```
r;   r1   r7   r/   r   r   r0   r2   r   r3   Nr4   r5   r6   r    )r   r   r   r   r   r   r   r   r   r   r    )Úgetr   r8   )r;   r+   ÚitemÚ
entry_datar1   r7   r:   s   &      r   Úparse_eval_result_entriesrB   ¤   sé   € ð8 €GÜˆØ—X‘X˜f dÓ+ˆ
Ø—.‘. ¨BÓ/ˆØ—‘ ¨"Ó-ˆÜØ˜t•}Ø˜WÕ%Ø˜IÕ&Ø$Ÿ[™[¨Ó4Ø#Ÿ™¨Ó6Ø—‘ Ó'ß,2�v—z‘z %Ô(¸ß.4˜Ÿ
™
 6Ô*¸$ß.4˜Ÿ
™
 6Ô*¸$ß,2�v—z‘z %Ô(¸Ø—.‘. Ó)ô
ˆð 	�‰�u×ñ# ð$ €Nr   N)r&   Údataclassesr   Útypingr   r   r<   rB   r	   r   r   Ú<module>rE      s;   ðñõ "Ý ð ÷Oð Oó ðOõdC÷L/r   