+
    QV-jË…  ã                   ó  € ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIHtH	t	 ]P                  ! ]4      t] ! R R4      4       t] ! R R	4      4       tR
 R lt ! R R]4      t ! R R]4      t ! R R]4      tR R ltR tR R ltR R ltR# )é    N)Údefaultdict)Ú	dataclass)ÚAny)ÚloggingÚ	yaml_dumpc                   ó    a € ] tR t^t o RtRtRtRtRtRt	Rt
RtRtRtRtRtRt]V 3R lR l4       tV 3R lR ltV 3R lR ltV 3R	 ltR
tV tR# )Ú
EvalResultuC  
Flattened representation of individual evaluation results found in model-index of Model Cards.

For more information on the model-index spec, see https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1.

Args:
    task_type (`str`):
        The task identifier. Example: "image-classification".
    dataset_type (`str`):
        The dataset identifier. Example: "common_voice". Use dataset id from https://hf.co/datasets.
    dataset_name (`str`):
        A pretty name for the dataset. Example: "Common Voice (French)".
    metric_type (`str`):
        The metric identifier. Example: "wer". Use metric id from https://hf.co/metrics.
    metric_value (`Any`):
        The metric value. Example: 0.9 or "20.0 Â± 1.2".
    task_name (`str`, *optional*):
        A pretty name for the task. Example: "Speech Recognition".
    dataset_config (`str`, *optional*):
        The name of the dataset configuration used in `load_dataset()`.
        Example: fr in `load_dataset("common_voice", "fr")`. See the `datasets` docs for more info:
        https://hf.co/docs/datasets/package_reference/loading_methods#datasets.load_dataset.name
    dataset_split (`str`, *optional*):
        The split used in `load_dataset()`. Example: "test".
    dataset_revision (`str`, *optional*):
        The revision (AKA Git Sha) of the dataset used in `load_dataset()`.
        Example: 5503434ddd753f426f4b38109466949a1217c2bb
    dataset_args (`dict[str, Any]`, *optional*):
        The arguments passed during `Metric.compute()`. Example for `bleu`: `{"max_order": 4}`
    metric_name (`str`, *optional*):
        A pretty name for the metric. Example: "Test WER".
    metric_config (`str`, *optional*):
        The name of the metric configuration used in `load_metric()`.
        Example: bleurt-large-512 in `load_metric("bleurt", "bleurt-large-512")`.
        See the `datasets` docs for more info: https://huggingface.co/docs/datasets/v2.1.0/en/loading#load-configurations
    metric_args (`dict[str, Any]`, *optional*):
        The arguments passed during `Metric.compute()`. Example for `bleu`: max_order: 4
    verified (`bool`, *optional*):
        Indicates whether the metrics originate from Hugging Face's [evaluation service](https://huggingface.co/spaces/autoevaluate/model-evaluator) or not. Automatically computed by Hugging Face, do not set.
    verify_token (`str`, *optional*):
        A JSON Web Token that is used to verify whether the metrics originate from Hugging Face's [evaluation service](https://huggingface.co/spaces/autoevaluate/model-evaluator) or not.
    source_name (`str`, *optional*):
        The name of the source of the evaluation result. Example: "Open LLM Leaderboard".
    source_url (`str`, *optional*):
        The URL of the source of the evaluation result. Example: "https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard".
Nc                ó    <€ V ^8„  d   QhRS[ /# ©é   Úreturn)Útuple)ÚformatÚ__classdict__s   "€Ún/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/huggingface_hub/repocard_data.pyÚ__annotate__ÚEvalResult.__annotate__‡   s   ø€ ÷ 
ñ 
¡5ñ 
ó    c                ót   € V P                   V P                  V P                  V P                  V P                  3# )z9Returns a tuple that uniquely identifies this evaluation.)Ú	task_typeÚdataset_typeÚdataset_configÚdataset_splitÚdataset_revision©Úselfs   &r   Úunique_identifierÚEvalResult.unique_identifier†   s9   € ð �N‰NØ×ÑØ×ÑØ×ÑØ×!Ñ!ð
ð 	
r   c                ó$   <€ V ^8„  d   QhRRRS[ /# )r   Úotherr	   r   ©Úbool)r   r   s   "€r   r   r   ‘   s   ø€ ÷ ñ ¨<ð ¹Dñ r   c                ó¨   € V P                   P                  4        F3  w  r#VR8X  d   K  VR8w  g   K  \        W4      \        W4      8w  g   K2   R# 	  R# )z`
Return True if `self` and `other` describe exactly the same metric but with a
different value.
Úmetric_valueÚverify_tokenFT)Ú__dict__ÚitemsÚgetattr)r   r    ÚkeyÚ_s   &&  r   Úis_equal_except_valueÚ EvalResult.is_equal_except_value‘   sK   € ð
 —m‘m×)Ñ)Ö+‰FˆCØ�nÔ$Ùð �nÖ$¬°Ó);¼wÀuÓ?RÖ)RÚñ ,ñ r   c                ó   <€ V ^8„  d   QhRR/# )r   r   N© )r   r   s   "€r   r   r   Ÿ   s   ø€ ÷ bñ b˜tñ br   c                óX   € V P                   e   V P                  f   \        R4      hR # R # )NzAIf `source_name` is provided, `source_url` must also be provided.)Úsource_nameÚ
source_urlÚ
ValueErrorr   s   &r   Ú__post_init__ÚEvalResult.__post_init__Ÿ   s,   € Ø×ÑÒ'¨D¯O©OÒ,CÜÐ`ÓaÐañ -DÑ'r   c                óº  <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R	&   S[ R,          ;R
&   S[S[ S[3,          R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[S[ S[3,          R,          ;R&   S[R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   # )r   r   r   Údataset_nameÚmetric_typer$   NÚ	task_namer   r   r   Údataset_argsÚmetric_nameÚmetric_configÚmetric_argsÚverifiedr%   r0   r1   )Ústrr   Údictr"   )r   r   s   "€r   r   r      sE  ø‡ ‚ ñj �Nñk ñr Ññs ñz Ññ{ ñB ÑñC ñJ ÑñK ñV �T�zÑ ñW ñb ˜$•JÑ%ñc ñj ˜•:Ñ$ñk ñr ˜D•jÑ'ñs ñz ‘s™C�x•. 4Õ'Ñ.ñ{ ñB �t•Ñ"ñC ñL ˜•:Ñ$ñM ñT ‘c™3�h• $Õ&Ñ-ñU ñZ �T�kÑ ñ[ ñ` ˜•*Ñ#ña ñh �t•Ñ"ñi ñp �d•
Ñ!òq r   r.   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r8   r   r   r   r9   r:   r;   r<   r=   r%   r0   r1   Úpropertyr   r+   r3   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__©r   s   @r   r	   r	      s�   ø‡ € ñ-ðR !€Ið "&€Nð !%€Mð $(Ðð +/€Lð #€Kð
 !%€Mð *.€Kð !€Hð  $€Lð #€Kð "€Jà÷
ó ð
÷ð ÷bð b÷g ƒ r   r	   c                   óÜ   a € ] tR t^¤t o RtRV 3R lR lltR tR tRV 3R lR lltR	 t	R
 t
RV 3R lR lltRV 3R lR lltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )ÚCardDataa’  Structure containing metadata from a RepoCard.

[`CardData`] is the parent class of [`ModelCardData`] and [`DatasetCardData`].

Metadata can be exported as a dictionary or YAML. Export can be customized to alter the representation of the data
(example: flatten evaluation results). `CardData` behaves as a dictionary (can get, pop, set values) but do not
inherit from `dict` to allow this export step.
c                ó    <€ V ^8„  d   QhRS[ /# )r   Úignore_metadata_errorsr!   )r   r   s   "€r   r   ÚCardData.__annotate__¯   s   ø€ ÷ %ñ %©tñ %r   c                ó<   € V P                   P                  V4       R # ©N)r&   Úupdate)r   rM   Úkwargss   &&,r   Ú__init__ÚCardData.__init__¯   s   € Ø�‰×Ñ˜VÖ$r   c                óÄ   € \         P                  ! V P                  4      pV P                  V4       VP	                  4        UUu/ uF  w  r#Vf   K  W#bK  	  upp# u uppi )z¢Converts CardData to a dict.

Returns:
    `dict`: CardData represented as a dictionary ready to be dumped to a YAML
    block for inclusion in a README.md file.
)ÚcopyÚdeepcopyr&   Ú_to_dictr'   )r   Ú	data_dictr)   Úvalues   &   r   Úto_dictÚCardData.to_dict²   sK   € ô —M’M $§-¡-Ó0ˆ	Ø�‰�iÔ Ø-6¯_©_Ô->ÔTÑ->™z˜sÀ%”
�’
Ñ->ÒTÐTùÓTs   ÁAÁAc                ó   € R# )zµUse this method in child classes to alter the dict representation of the data. Alter the dict in-place.

Args:
    data_dict (`dict`): The raw dict representation of the card data.
Nr.   ©r   rY   s   &&r   rX   ÚCardData._to_dict¾   s   € ñ 	r   Nc                óD   <€ V ^8„  d   QhRS[ S[,          R,          RS[/# )r   Úoriginal_orderNr   ©Úlistr>   )r   r   s   "€r   r   rN   Æ   s)   ø€ ÷ Yñ Y±t¹CµyÀ4Õ7Gð YÑSVñ Yr   c                óf  € V'       d|   V\        \        V P                  P                  4       4      \        V4      ,
          4      ,            Uu/ uF(  pW0P                  9   g   K  W0P                  V,          bK*  	  upV n        \	        V P                  4       RVR7      P                  4       # u upi )a&  Dumps CardData to a YAML block for inclusion in a README.md file.

Args:
    line_break (str, *optional*):
        The line break to use when dumping to yaml.
    original_order (`list[str]`, *optional*):
        If provided, reorder the metadata fields to match this list before dumping.
        Any keys not in `original_order` are appended after the listed keys, preserving
        their existing relative order. Useful for round-tripping a YAML block without
        shuffling its keys.

Returns:
    `str`: CardData represented as a YAML block.
F)Ú	sort_keysÚ
line_break)rc   Úsetr&   Úkeysr   r[   Ústrip)r   rf   ra   Úks   &&& r   Úto_yamlÚCardData.to_yamlÆ   s‹   € ÷ ð (¬$¬s°4·=±=×3EÑ3EÓ3GÓ/HÌ3È~ÓK^Õ/^Ó*_Ö_óá_�AØŸ™Ñ%ô $�—=‘= Õ#Ò#Ù_ñˆDŒMô
 ˜Ÿ™›°5ÀZÔP×VÑVÓXÐXùòs   ÁB.Á%B.c                ó,   € \        V P                  4      # rP   )Úreprr&   r   s   &r   Ú__repr__ÚCardData.__repr__Ý   s   € Ü�D—M‘MÓ"Ð"r   c                ó"   € V P                  4       # rP   )rk   r   s   &r   Ú__str__ÚCardData.__str__à   s   € Ø�|‰|‹~Ðr   c                ó,   <€ V ^8„  d   QhRS[ RS[RS[/# ©r   r)   Údefaultr   ©r>   r   )r   r   s   "€r   r   rN   ã   s"   ø€ ÷ 3ñ 3‘sð 3¡Sð 3±Cñ 3r   c                óH   € V P                   P                  V4      pVf   V# T# ©z#Get value for a given metadata key.)r&   Úget)r   r)   rv   rZ   s   &&& r   rz   ÚCardData.getã   s%   € à—‘×!Ñ! #Ó&ˆØš-ˆwÐ2¨UÐ2r   c                ó,   <€ V ^8„  d   QhRS[ RS[RS[/# ru   rw   )r   r   s   "€r   r   rN   è   s"   ø€ ÷ /ñ /‘sð /¡Sð /±Cñ /r   c                ó8   € V P                   P                  W4      # )z#Pop value for a given metadata key.)r&   Úpop)r   r)   rv   s   &&&r   r~   ÚCardData.popè   s   € à�}‰}× Ñ  Ó.Ð.r   c                ó&   <€ V ^8„  d   QhRS[ RS[/# ©r   r)   r   rw   )r   r   s   "€r   r   rN   ì   s   ø€ ÷ "ñ "™sð "¡sñ "r   c                ó(   € V P                   V,          # ry   ©r&   ©r   r)   s   &&r   Ú__getitem__ÚCardData.__getitem__ì   s   € à�}‰}˜SÕ!Ð!r   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   r)   rZ   r   Nrw   )r   r   s   "€r   r   rN   ð   s"   ø€ ÷ #ñ #™sð #©3ð #°4ñ #r   c                ó"   € W P                   V&   R# )z#Set value for a given metadata key.Nrƒ   )r   r)   rZ   s   &&&r   Ú__setitem__ÚCardData.__setitem__ð   s   € à"�‰�cÓr   c                ó&   <€ V ^8„  d   QhRS[ RS[/# r�   )r>   r"   )r   r   s   "€r   r   rN   ô   s   ø€ ÷ $ñ $¡ð $©ñ $r   c                ó   € WP                   9   # )z%Check if a given metadata key is set.rƒ   r„   s   &&r   Ú__contains__ÚCardData.__contains__ô   s   € à—m‘mÑ#Ð#r   c                ó    <€ V ^8„  d   QhRS[ /# r   )Úint)r   r   s   "€r   r   rN   ø   s   ø€ ÷ "ñ "™ñ "r   c                ó,   € \        V P                  4      # )z'Return the number of metadata keys set.)Úlenr&   r   s   &r   Ú__len__ÚCardData.__len__ø   s   € ä�4—=‘=Ó!Ð!r   rƒ   )F)NNrP   )r@   rA   rB   rC   rD   rS   r[   rX   rk   ro   rr   rz   r~   r…   r‰   r�   r“   rG   rH   rI   s   @r   rK   rK   ¤   sq   ø‡ € ñ÷%ò %ò
Uò÷Yò Yò.#ò÷3ò 3÷
/ò /÷"ð "÷#ð #÷$ð $÷"ö "r   rK   c                óš   € V ^8„  d   QhR\         \        \         ,          ,          R,          R\        R,          R\        \         ,          /# )r   Úeval_resultsNÚ
model_namer   )r	   rc   r>   )r   s   "r   r   r   ý   s>   € ÷ ñ Üœt¤JÕ/Õ/°$Õ6ðä�d•
ðô 
Œ*Õñr   c                 ó2  € V f   . # \        V \        4      '       d   V .p \        V \        4      '       d;   \        ;QJ d    R V  4       F  '       d   K   RM	  RM! R V  4       4      '       g   \	        R\        V 4       R24      hVf   \	        R4      hV # )Nc              3   óB   "  € T F  p\        V\        4      x € K  	  R # 5irP   )Ú
isinstancer	   )Ú.0Úrs   & r   Ú	<genexpr>Ú)_validate_eval_results.<locals>.<genexpr>  s   é € Ð4eÑXdÐST´ZÀÄ:×5NÐ5NÓXdùs   ‚FTzM`eval_results` should be of type `EvalResult` or a list of `EvalResult`, got Ú.z7Passing `eval_results` requires `model_name` to be set.)rš   r	   rc   Úallr2   Útype)r–   r—   s   &&r   Ú_validate_eval_resultsr¢   ý   sŽ   € ð ÒØˆ	Ü�,¤
×+Ò+Ø$�~ˆÜ�l¤D×)Ò)·³Ñ4eÑXdÓ4e··²Ñ4eÑXdÓ4e×1eÒ1eÜØ[Ô\`ÐamÓ\nÐ[oÐopÐqó
ð 	
ð ÒÜÐRÓSÐSØÐr   c                   ó€   a a€ ] tR tRt oRtRRRRRRRRRRR	RR
RRRRRRRRRRRRR/V3R lV 3R llltR tRtVtV ;t	# )ÚModelCardDatai  ai  Model Card Metadata that is used by Hugging Face Hub when included at the top of your README.md

Args:
    base_model (`str` or `list[str]`, *optional*):
        The identifier of the base model from which the model derives. This is applicable for example if your model is a
        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
        if your model derives from multiple models). Defaults to None.
    datasets (`Union[str, list[str]]`, *optional*):
        Dataset or list of datasets that were used to train this model. Should be a dataset ID
        found on https://hf.co/datasets. Defaults to None.
    eval_results (`Union[list[EvalResult], EvalResult]`, *optional*):
        List of `huggingface_hub.EvalResult` that define evaluation results of the model. If provided,
        `model_name` is used to as a name on PapersWithCode's leaderboards. Defaults to `None`.
    language (`Union[str, list[str]]`, *optional*):
        Language of model's training data or metadata. It must be an ISO 639-1, 639-2 or
        639-3 code (two/three letters), or a special value like "code", "multilingual". Defaults to `None`.
    library_name (`str`, *optional*):
        Name of library used by this model. Example: keras or any library from
        https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/src/model-libraries.ts.
        Defaults to None.
    license (`str`, *optional*):
        License of this model. Example: apache-2.0 or any license from
        https://huggingface.co/docs/hub/repositories-licenses. Defaults to None.
    license_name (`str`, *optional*):
        Name of the license of this model. Defaults to None. To be used in conjunction with `license_link`.
        Common licenses (Apache-2.0, MIT, CC-BY-SA-4.0) do not need a name. In that case, use `license` instead.
    license_link (`str`, *optional*):
        Link to the license of this model. Defaults to None. To be used in conjunction with `license_name`.
        Common licenses (Apache-2.0, MIT, CC-BY-SA-4.0) do not need a link. In that case, use `license` instead.
    metrics (`list[str]`, *optional*):
        List of metrics used to evaluate this model. Should be a metric name that can be found
        at https://hf.co/metrics. Example: 'accuracy'. Defaults to None.
    model_name (`str`, *optional*):
        A name for this model. It is used along with
        `eval_results` to construct the `model-index` within the card's metadata. The name
        you supply here is what will be used on PapersWithCode's leaderboards. If None is provided
        then the repo name is used as a default. Defaults to None.
    pipeline_tag (`str`, *optional*):
        The pipeline tag associated with the model. Example: "text-classification".
    tags (`list[str]`, *optional*):
        List of tags to add to your model that can be used when filtering on the Hugging
        Face Hub. Defaults to None.
    ignore_metadata_errors (`str`):
        If True, errors while parsing the metadata section will be ignored. Some information might be lost during
        the process. Use it at your own risk.
    kwargs (`dict`, *optional*):
        Additional metadata that will be added to the model card. Defaults to None.

Example:
    ```python
    >>> from huggingface_hub import ModelCardData
    >>> card_data = ModelCardData(
    ...     language="en",
    ...     license="mit",
    ...     library_name="timm",
    ...     tags=['image-classification', 'resnet'],
    ... )
    >>> card_data.to_dict()
    {'language': 'en', 'license': 'mit', 'library_name': 'timm', 'tags': ['image-classification', 'resnet']}

    ```
Ú
base_modelNÚdatasetsr–   ÚlanguageÚlibrary_nameÚlicenseÚlicense_nameÚlicense_linkÚmetricsr—   Úpipeline_tagÚtagsrM   Fc                ó   <€ V ^8„  d   QhRS[ S[S[ ,          ,          R,          RS[ S[S[ ,          ,          R,          RS[S[,          R,          RS[ S[S[ ,          ,          R,          RS[ R,          RS[ R,          RS[ R,          R	S[ R,          R
S[S[ ,          R,          RS[ R,          RS[ R,          RS[S[ ,          R,          RS[/# )r   r¥   Nr¦   r–   r§   r¨   r©   rª   r«   r¬   r—   r­   r®   rM   )r>   rc   r	   r"   )r   r   s   "€r   r   ÚModelCardData.__annotate__N  sù   ø€ ÷ 8Uñ 8Uñ ™$™s�)•O dÕ*ð8Uñ ™™S�	•/ DÕ(ð	8Uñ
 ™:Õ&¨Õ-ð8Uñ ™™S�	•/ DÕ(ð8Uñ ˜D•jð8Uñ �t•ð8Uñ ˜D•jð8Uñ ˜D•jð8Uñ ‘c•˜TÕ!ð8Uñ ˜$•Jð8Uñ ˜D•jð8Uñ ‘3�i˜$Õð8Uñ !%ñ8Ur   c               óè  <€ Wn         W n        W0n        W@n        WPn        W`n        Wpn        W€n        W�n        W n	        W°n
        \        V4      V n        VP                  R R4      pV'       d    \        V4      w  r£W n	        W0n        \*        SV `X  ! R/ VB  V P                  '       d)    \/        V P                  V P                  4      V n        R# R#   \        \         3 dD   pT'       d   \"        P%                  R4        Rp?L\'        RTP(                   RT R24      hRp?ii ; i  \0         d<   pT'       d    \"        P%                  RT R24        Rp?R# \'        RT 24      ThRp?ii ; i)	úmodel-indexNz<Invalid model-index. Not loading eval results into CardData.z4Invalid `model_index` in metadata cannot be parsed: Ú z–. Pass `ignore_metadata_errors=True` to ignore this error while loading a Model Card. Warning: some information will be lost. Use it at your own risk.z!Failed to validate eval_results: z). Not loading eval results into CardData.r.   )r¥   r¦   r–   r§   r¨   r©   rª   r«   r¬   r—   r­   Ú_to_unique_listr®   r~   Úmodel_index_to_eval_resultsÚKeyErrorÚ	TypeErrorÚloggerÚwarningr2   Ú	__class__ÚsuperrS   r¢   Ú	Exception)r   r¥   r¦   r–   r§   r¨   r©   rª   r«   r¬   r—   r­   r®   rM   rR   Úmodel_indexÚerrorÚerº   s   &$$$$$$$$$$$$$,   €r   rS   ÚModelCardData.__init__N  s^  ø€ ð$ %ŒØ ŒØ(ÔØ ŒØ(ÔØŒØ(ÔØ(ÔØŒØ$ŒØ(ÔÜ# DÓ)ˆŒ	à—j‘j °Ó5ˆßðÜ+FÀ{Ó+SÑ(�
Ø",”Ø$0Ô!ô 	‰ÒÑ"˜6Ò"à××ÐðUÜ$:¸4×;LÑ;LÈdÏoÉoÓ$^�Ö!ñ øô œiÐ(ô ß)Ü—N‘NÐ#a×bÑbä$ØNÈuÏÉÐN_Ð_`ÐafÐ`gð hSð Sóð ûð	ûô ô Uß)Ü—N‘NÐ%FÀqÀcÐIrÐ#s×tÒtä$Ð'HÈÈÐ%LÓMÐSTÐTûð	Uús<   Á/C Â+%D+ ÃD(Ã%D#ÄD#Ä#D(Ä+E1Ä6!E,ÅE,Å,E1c                óx   € V P                   e,   \        V P                  V P                   4      VR&   VR VR R# R# )z[Format the internal data dict. In this case, we convert eval results to a valid model indexNr²   r–   r—   )r–   Úeval_results_to_model_indexr—   r^   s   &&r   rX   ÚModelCardData._to_dictˆ  s>   € à×ÑÒ(Ü'BÀ4Ç?Á?ÐTX×TeÑTeÓ'fˆI�mÑ$Ø˜.Ð)¨9°\Ò+Bñ )r   )r¥   r¦   r–   r§   r¨   r©   r«   rª   r¬   r—   r­   r®   ©
r@   rA   rB   rC   rD   rS   rX   rG   rH   Ú__classcell__©rº   r   s   @@r   r¤   r¤     s³   ù‡ € ñ=ð~8Uð .2ð8Uð ,0ð	8Uð
 15ð8Uð ,0ð8Uð $(ð8Uð #ð8Uð $(ð8Uð $(ð8Uð %)ð8Uð "&ð8Uð $(ð8Uð "&ð8Uð (-÷8Uõ 8U÷tCò Cr   r¤   c                   ó„   a a€ ] tR tRt oRtRRRRRRRRRRR	RR
RRRRRRRRRRRRRRR/V3R lV 3R llltR tRtVtV ;t	# )ÚDatasetCardDatai�  aG	  Dataset Card Metadata that is used by Hugging Face Hub when included at the top of your README.md

Args:
    language (`list[str]`, *optional*):
        Language of dataset's data or metadata. It must be an ISO 639-1, 639-2 or
        639-3 code (two/three letters), or a special value like "code", "multilingual".
    license (`Union[str, list[str]]`, *optional*):
        License(s) of this dataset. Example: apache-2.0 or any license from
        https://huggingface.co/docs/hub/repositories-licenses.
    annotations_creators (`Union[str, list[str]]`, *optional*):
        How the annotations for the dataset were created.
        Options are: 'found', 'crowdsourced', 'expert-generated', 'machine-generated', 'no-annotation', 'other'.
    language_creators (`Union[str, list[str]]`, *optional*):
        How the text-based data in the dataset was created.
        Options are: 'found', 'crowdsourced', 'expert-generated', 'machine-generated', 'other'
    multilinguality (`Union[str, list[str]]`, *optional*):
        Whether the dataset is multilingual.
        Options are: 'monolingual', 'multilingual', 'translation', 'other'.
    size_categories (`Union[str, list[str]]`, *optional*):
        The number of examples in the dataset. Options are: 'n<1K', '1K<n<10K', '10K<n<100K',
        '100K<n<1M', '1M<n<10M', '10M<n<100M', '100M<n<1B', '1B<n<10B', '10B<n<100B', '100B<n<1T', 'n>1T', and 'other'.
    source_datasets (`list[str]]`, *optional*):
        Indicates whether the dataset is an original dataset or extended from another existing dataset.
        Options are: 'original' and 'extended'.
    task_categories (`Union[str, list[str]]`, *optional*):
        What categories of task does the dataset support?
    task_ids (`Union[str, list[str]]`, *optional*):
        What specific tasks does the dataset support?
    paperswithcode_id (`str`, *optional*):
        ID of the dataset on PapersWithCode.
    pretty_name (`str`, *optional*):
        A more human-readable name for the dataset. (ex. "Cats vs. Dogs")
    train_eval_index (`dict`, *optional*):
        A dictionary that describes the necessary spec for doing evaluation on the Hub.
        If not provided, it will be gathered from the 'train-eval-index' key of the kwargs.
    config_names (`Union[str, list[str]]`, *optional*):
        A list of the available dataset configs for the dataset.
r§   Nr©   Úannotations_creatorsÚlanguage_creatorsÚmultilingualityÚsize_categoriesÚsource_datasetsÚtask_categoriesÚtask_idsÚpaperswithcode_idÚpretty_nameÚtrain_eval_indexÚconfig_namesrM   Fc                óT  <€ V ^8„  d   QhRS[ S[S[ ,          ,          R,          RS[ S[S[ ,          ,          R,          RS[ S[S[ ,          ,          R,          RS[ S[S[ ,          ,          R,          RS[ S[S[ ,          ,          R,          RS[ S[S[ ,          ,          R,          RS[S[ ,          R,          R	S[ S[S[ ,          ,          R,          R
S[ S[S[ ,          ,          R,          RS[ R,          RS[ R,          RS[R,          RS[ S[S[ ,          ,          R,          RS[/# )r   r§   Nr©   rÉ   rÊ   rË   rÌ   rÍ   rÎ   rÏ   rÐ   rÑ   rÒ   rÓ   rM   )r>   rc   r?   r"   )r   r   s   "€r   r   ÚDatasetCardData.__annotate__·  s#  ø€ ÷ "#ñ "#ñ ™™S�	•/ DÕ(ð"#ñ ‘t™C•y• 4Õ'ð	"#ñ
 "¡D©¥I�o°Õ4ð"#ñ ¡¡c¥�?¨TÕ1ð"#ñ ™t¡C�y�¨4Õ/ð"#ñ ™t¡C�y�¨4Õ/ð"#ñ ™c� TÕ)ð"#ñ ™t¡C�y�¨4Õ/ð"#ñ ™™S�	•/ DÕ(ð"#ñ  �:ð"#ñ ˜4•Zð"#ñ  �+ð"#ñ ™D¡�I•o¨Õ,ð"#ñ  !%ñ!"#r   c               óú   <€ W0n         W@n        Wn        W n        WPn        W`n        Wpn        W€n        W�n        W n	        W°n
        WÐn        T;'       g    VP                  R R4      V n        \        SV `<  ! R/ VB  R# )útrain-eval-indexNr.   )rÉ   rÊ   r§   r©   rË   rÌ   rÍ   rÎ   rÏ   rÐ   rÑ   rÓ   r~   rÒ   r»   rS   )r   r§   r©   rÉ   rÊ   rË   rÌ   rÍ   rÎ   rÏ   rÐ   rÑ   rÒ   rÓ   rM   rR   rº   s   &$$$$$$$$$$$$$$,€r   rS   ÚDatasetCardData.__init__·  sy   ø€ ð& %9Ô!Ø!2ÔØ ŒØŒØ.ÔØ.ÔØ.ÔØ.ÔØ ŒØ!2ÔØ&ÔØ(Ôð !1× XÐ X°F·J±JÐ?QÐSWÓ4XˆÔÜ‰ÒÑ"˜6Ô"r   c                ó.   € VP                  R 4      VR&   R# )rÒ   r×   N)r~   r^   s   &&r   rX   ÚDatasetCardData._to_dictÛ  s   € Ø(1¯©Ð6HÓ(Iˆ	Ð$Ó%r   )rÉ   rÓ   r§   rÊ   r©   rË   rÐ   rÑ   rÌ   rÍ   rÎ   rÏ   rÒ   rÄ   rÆ   s   @@r   rÈ   rÈ   �  s®   ù‡ € ñ%ðN"#ð ,0ð"#ð +/ð	"#ð
 8<ð"#ð 59ð"#ð 37ð"#ð 37ð"#ð -1ð"#ð 37ð"#ð ,0ð"#ð )-ð"#ð #'ð"#ð )-ð"#ð 04ð"#ð  (-÷!"#õ "#÷HJò Jr   rÈ   c                   óv   a a€ ] tR tRt oRtRRRRRRRRRRR	RR
RRRRRRRRRRR/V3R lV 3R llltRtVtV ;t# )ÚSpaceCardDataiß  a8	  Space Card Metadata that is used by Hugging Face Hub when included at the top of your README.md

To get an exhaustive reference of Spaces configuration, please visit https://huggingface.co/docs/hub/spaces-config-reference#spaces-configuration-reference.

Args:
    title (`str`, *optional*)
        Title of the Space.
    sdk (`str`, *optional*)
        SDK of the Space (one of `gradio`, `streamlit`, `docker`, or `static`).
    sdk_version (`str`, *optional*)
        Version of the used SDK (if Gradio/Streamlit sdk).
    python_version (`str`, *optional*)
        Python version used in the Space (if Gradio/Streamlit sdk).
    app_file (`str`, *optional*)
        Path to your main application file (which contains either gradio or streamlit Python code, or static html code).
        Path is relative to the root of the repository.
    app_port (`str`, *optional*)
        Port on which your application is running. Used only if sdk is `docker`.
    license (`str`, *optional*)
        License of this model. Example: apache-2.0 or any license from
        https://huggingface.co/docs/hub/repositories-licenses.
    duplicated_from (`str`, *optional*)
        ID of the original Space if this is a duplicated Space.
    models (list[`str`], *optional*)
        List of models related to this Space. Should be a dataset ID found on https://hf.co/models.
    datasets (`list[str]`, *optional*)
        List of datasets related to this Space. Should be a dataset ID found on https://hf.co/datasets.
    tags (`list[str]`, *optional*)
        List of tags to add to your Space that can be used when filtering on the Hub.
    ignore_metadata_errors (`str`):
        If True, errors while parsing the metadata section will be ignored. Some information might be lost during
        the process. Use it at your own risk.
    kwargs (`dict`, *optional*):
        Additional metadata that will be added to the space card.

Example:
    ```python
    >>> from huggingface_hub import SpaceCardData
    >>> card_data = SpaceCardData(
    ...     title="Dreambooth Training",
    ...     license="mit",
    ...     sdk="gradio",
    ...     duplicated_from="multimodalart/dreambooth-training"
    ... )
    >>> card_data.to_dict()
    {'title': 'Dreambooth Training', 'sdk': 'gradio', 'license': 'mit', 'duplicated_from': 'multimodalart/dreambooth-training'}
    ```
ÚtitleNÚsdkÚsdk_versionÚpython_versionÚapp_fileÚapp_portr©   Úduplicated_fromÚmodelsr¦   r®   rM   Fc                ó,  <€ V ^8„  d   Qh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
S[S[ ,          R,          RS[S[ ,          R,          RS[S[ ,          R,          RS[/# )r   rÝ   NrÞ   rß   rà   rá   râ   r©   rã   rä   r¦   r®   rM   )r>   r�   rc   r"   )r   r   s   "€r   r   ÚSpaceCardData.__annotate__  sÀ   ø€ ÷ #ñ #ñ �T�zð#ñ �4�Zð	#ñ
 ˜4•Zð#ñ ˜d�
ð#ñ ˜•*ð#ñ ˜•*ð#ñ �t•ð#ñ ˜t�ð#ñ ‘S•	˜DÕ ð#ñ ‘s•)˜dÕ"ð#ñ ‘3�i˜$Õð#ñ !%ñ#r   c               óÀ   <€ Wn         W n        W0n        W@n        WPn        W`n        Wpn        W€n        W�n        W n	        \        V4      V n        \        SV `4  ! R/ VB  R # )Nr.   )rÝ   rÞ   rß   rà   rá   râ   r©   rã   rä   r¦   r´   r®   r»   rS   )r   rÝ   rÞ   rß   rà   rá   râ   r©   rã   rä   r¦   r®   rM   rR   rº   s   &$$$$$$$$$$$$,€r   rS   ÚSpaceCardData.__init__  sV   ø€ ð" Œ
ØŒØ&ÔØ,ÔØ ŒØ ŒØŒØ.ÔØŒØ ŒÜ# DÓ)ˆŒ	Ü‰ÒÑ"˜6Ô"r   )rá   râ   r¦   rã   r©   rä   rà   rÞ   rß   r®   rÝ   )	r@   rA   rB   rC   rD   rS   rG   rH   rÅ   rÆ   s   @@r   rÜ   rÜ   ß  s’   ù‡ € ñ/ðb#ð !ð#ð ð	#ð
 #'ð#ð &*ð#ð  $ð#ð  $ð#ð #ð#ð '+ð#ð $(ð#ð &*ð#ð "&ð#ð (-÷#÷ #õ #r   rÜ   c                ó    € V ^8„  d   QhR\         \        \        \        3,          ,          R\        \        \         \
        ,          3,          /# )r   r½   r   )rc   r?   r>   r   r   r	   )r   s   "r   r   r   0  s<   € ÷ eñ e¬T´$´s¼C°xµ.Õ-Að eÄeÌCÔQUÔV`ÕQaÐLaÕFbñ er   c           	     óº  € . pV  EFÏ  pVR,          pVR,          pV EF²  pVR,          R,          pVR,          P                  R4      pVR,          R,          pVR,          R,          p	VR,          P                  R4      p
VR,          P                  R4      pVR,          P                  R4      pVR,          P                  R	4      pVP                  R
/ 4      P                  R4      pVP                  R
/ 4      P                  R4      pVR,           F·  pVR,          pVR,          pVP                  R4      pVP                  R	4      pVP                  R4      pVP                  R4      pVP                  R4      p\        R / RVbRVbRV	bRVbRVbRVbRV
bRVbRVbRVbRVbRVbRVbRVbRVbRVbRVb pVP                  V4       K¹  	  EKµ  	  EKÒ  	  XV3# )!a  Takes in a model index and returns the model name and a list of `huggingface_hub.EvalResult` objects.

A detailed spec of the model index can be found here:
https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1

Args:
    model_index (`list[dict[str, Any]]`):
        A model index data structure, likely coming from a README.md file on the
        Hugging Face Hub.

Returns:
    model_name (`str`):
        The name of the model as found in the model index. This is used as the
        identifier for the model on leaderboards like PapersWithCode.
    eval_results (`list[EvalResult]`):
        A list of `huggingface_hub.EvalResult` objects containing the metrics
        reported in the provided model_index.

Example:
    ```python
    >>> from huggingface_hub.repocard_data import model_index_to_eval_results
    >>> # Define a minimal model index
    >>> model_index = [
    ...     {
    ...         "name": "my-cool-model",
    ...         "results": [
    ...             {
    ...                 "task": {
    ...                     "type": "image-classification"
    ...                 },
    ...                 "dataset": {
    ...                     "type": "beans",
    ...                     "name": "Beans"
    ...                 },
    ...                 "metrics": [
    ...                     {
    ...                         "type": "accuracy",
    ...                         "value": 0.9
    ...                     }
    ...                 ]
    ...             }
    ...         ]
    ...     }
    ... ]
    >>> model_name, eval_results = model_index_to_eval_results(model_index)
    >>> model_name
    'my-cool-model'
    >>> eval_results[0].task_type
    'image-classification'
    >>> eval_results[0].metric_type
    'accuracy'

    ```
ÚnameÚresultsÚtaskr¡   ÚdatasetÚconfigÚsplitÚrevisionÚargsÚsourceÚurlr¬   rZ   r=   ÚverifyTokenr   r   r6   r7   r$   r8   r   r   r   r9   r:   r<   r;   r%   r0   r1   r.   )rz   r	   Úappend)r½   r–   Úelemrë   rì   Úresultr   r8   r   r6   r   r   r   r9   r0   r1   Úmetricr7   r$   r:   r<   r;   r=   r%   Úeval_results   &                        r   rµ   rµ   0  s3  € ðp €LÜˆØ�F�|ˆØ�y•/ˆÜˆFØ˜v� vÕ.ˆIØ˜v�×*Ñ*¨6Ó2ˆIØ! )Õ,¨VÕ4ˆLØ! )Õ,¨VÕ4ˆLØ# IÕ.×2Ñ2°8Ó<ˆNØ" 9Õ-×1Ñ1°'Ó:ˆMØ% iÕ0×4Ñ4°ZÓ@ÐØ! )Õ,×0Ñ0°Ó8ˆLØ Ÿ*™* X¨rÓ2×6Ñ6°vÓ>ˆKØŸ™ H¨bÓ1×5Ñ5°eÓ<ˆJà  ×+Ð+�Ø$ V�n�Ø% g��Ø$Ÿj™j¨Ó0�Ø$Ÿj™j¨Ó0�Ø &§
¡
¨8Ó 4�Ø!Ÿ:™: jÓ1�Ø%Ÿz™z¨-Ó8�ä(ò Ù'ðá!-ðñ ".ðñ !,ð	ñ
 ".ðñ (ðñ $2ðñ #0ðñ &6ðñ ".ðñ !,ðñ !,ðñ #0ðñ &ðñ ".ðñ  !,ð!ñ"  *ð#�ð& ×#Ñ# KÖ0ô9 ,ô ñ ðX �ÐÐr   c                óð   € \        V \        \        \        34      '       d   \	        V 4      ! R V  4       4      # \        V \
        4      '       d'   \	        V 4      ! R V P                  4        4       4      # V # )zc
Recursively remove `None` values from a dict. Borrowed from: https://stackoverflow.com/a/20558778
c              3   óB   "  € T F  qf   K  \        V4      x € K  	  R # 5irP   ©Ú_remove_none)r›   Úxs   & r   r�   Ú_remove_none.<locals>.<genexpr>�  s   é € ÐG±#¨Qœœ aŸ˜³#ùs   ‚Œc              3   ój   "  € T F)  w  rVf   K  Vf   K  \        V4      \        V4      3x € K+  	  R # 5irP   rý   )r›   rj   Úvs   &  r   r�   r   Ÿ  s+   é € ÐwÉÁÀÐWXÔ;ÐijÔ;œ, q›/¬<¸«?Õ;Ëùs   ‚3�3•3)rš   rc   r   rg   r¡   r?   r'   )Úobjs   &r   rþ   rþ   ˜  sZ   € ô �#œœe¤SÐ)×*Ò*Ü�CŒyÑG±#ÓGÓGÐGÜ	�Cœ×	Ò	Ü�CŒyÑwÈÏ	É	ÌÓwÓwÐwàˆ
r   c          	      óŠ   € V ^8„  d   QhR\         R\        \        ,          R\        \        \         \        3,          ,          /# )r   r—   r–   r   )r>   rc   r	   r?   r   )r   s   "r   r   r   ¤  s>   € ÷ Y%ñ Y%¬Cð Y%¼tÄJÕ?Oð Y%ÔTXÔY]Ô^aÔcfÐ^fÕYgÕThñ Y%r   c                ó  € \        \        4      pV F$  pW#P                  ,          P                  V4       K&  	  . pVP	                  4        EF'  pV^ ,          pRRVP
                  RVP                  /RRVP                  RVP                  RVP                  RVP                  RVP                  RVP                  /R	V Uu. uFY  pRVP                  R
VP                  RVP                  RVP                   RVP"                  RVP$                  RVP&                  /NK[  	  up/pVP(                  e0   RVP(                  /p	VP*                  e   VP*                  V	R&   W˜R&   VP                  V4       EK*  	  RV RV/.p
\-        V
4      # u upi )a@  Takes in given model name and list of `huggingface_hub.EvalResult` and returns a
valid model-index that will be compatible with the format expected by the
Hugging Face Hub.

Args:
    model_name (`str`):
        Name of the model (ex. "my-cool-model"). This is used as the identifier
        for the model on leaderboards like PapersWithCode.
    eval_results (`list[EvalResult]`):
        List of `huggingface_hub.EvalResult` objects containing the metrics to be
        reported in the model-index.

Returns:
    model_index (`list[dict[str, Any]]`): The eval_results converted to a model-index.

Example:
    ```python
    >>> from huggingface_hub.repocard_data import eval_results_to_model_index, EvalResult
    >>> # Define minimal eval_results
    >>> eval_results = [
    ...     EvalResult(
    ...         task_type="image-classification",  # Required
    ...         dataset_type="beans",  # Required
    ...         dataset_name="Beans",  # Required
    ...         metric_type="accuracy",  # Required
    ...         metric_value=0.9,  # Required
    ...     )
    ... ]
    >>> eval_results_to_model_index("my-cool-model", eval_results)
    [{'name': 'my-cool-model', 'results': [{'task': {'type': 'image-classification'}, 'dataset': {'name': 'Beans', 'type': 'beans'}, 'metrics': [{'type': 'accuracy', 'value': 0.9}]}]}]

    ```
rí   r¡   rë   rî   rï   rð   rñ   rò   r¬   rZ   r=   rõ   rô   ró   rì   )r   rc   r   rö   Úvaluesr   r8   r6   r   r   r   r   r9   r7   r$   r:   r;   r<   r=   r%   r1   r0   rþ   )r—   r–   Útask_and_ds_types_maprú   Úmodel_index_datarì   Úsample_resultrø   Údataró   r½   s   &&         r   rÂ   rÂ   ¤  s¹  € ôJ :EÄTÓ9JÐÛ#ˆØ×;Ñ;Õ<×CÑCÀKÖPñ $ð .0ÐØ(×/Ñ/×1ˆà �
ˆàØ˜×/Ñ/Ø˜×/Ñ/ðð Ø˜×2Ñ2Ø˜×2Ñ2Ø˜-×6Ñ6Ø˜×4Ñ4Ø˜M×:Ñ:Ø˜×2Ñ2ðð ñ &óñ &�Fð ˜F×.Ñ.Ø˜V×0Ñ0Ø˜F×.Ñ.Ø˜f×2Ñ2Ø˜F×.Ñ.Ø §¡Ø! 6×#6Ñ#6óñ &ñð 
ˆð4 ×#Ñ#Ò/à�}×/Ñ/ð&ˆFð ×(Ñ(Ò4Ø!.×!:Ñ!:��v‘Ø#�‰NØ×Ñ ×%ñI 2ðT �JØÐ'ð	
ð€Kô ˜Ó$Ð$ùò=s   ÃAF
c                óx   € V ^8„  d   QhR\         \        ,          R,          R\         \        ,          R,          /# )r   r®   Nr   rb   )r   s   "r   r   r      s,   € ÷ ñ œ$œs�) dÕ*ð ¬t´C­y¸4Õ/?ñ r   c                 óZ   € V f   V # . pV  F  pW!9  g   K  VP                  V4       K  	  V# rP   )rö   )r®   Úunique_tagsÚtags   &  r   r´   r´      s7   € Ø‚|ØˆØ€KÛˆØÖ!Ø×Ñ˜sÖ#ñ ð Ðr   )rV   Úcollectionsr   Údataclassesr   Útypingr   Úhuggingface_hub.utilsr   r   Ú
get_loggerr@   r¸   r	   rK   r¢   r¤   rÈ   rÜ   rµ   rþ   rÂ   r´   r.   r   r   Ú<module>r     s±   ðÛ Ý #Ý !Ý ç 4ð 
×	Ò	˜HÓ	%€ð ÷Tbð Tbó ðTbðn ÷U"ð U"ó ðU"õpô"~C�Hô ~CôBMJ�hô MJô`N#�Hô N#õbeòP	õY%÷xr   