Ë
    BêñiY7  ã                   óâ  — d Z ddlmZ ddlmZmZ  G d„ de«      Z G d„ de«      Z G d„ d	e	«      Z
 G d
„ de«      Z G d„ dee«      Z G d„ dee«      Z G d„ de«      Z G d„ dee«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d „ d!e«      Z G d"„ d#e«      Z G d$„ d%e«      Z G d&„ d'e«      Z G d(„ d)e«      Z G d*„ d+e«      Z G d,„ d-e«      Z  G d.„ d/e «      Z! G d0„ d1e«      Z" G d2„ d3e«      Z# G d4„ d5e«      Z$ G d6„ d7ee$«      Z% G d8„ d9e&e$«      Z' G d:„ d;ee«      Z( G d<„ d=e«      Z) G d>„ d?e)«      Z* G d@„ dAe)«      Z+ G dB„ dCe+«      Z, G dD„ dEe«      Z- G dF„ dGe-«      Z. G dH„ dIe-«      Z/ G dJ„ dKe-«      Z0 G dL„ dMe«      Z1 G dN„ dOe1«      Z2 G dP„ dQe1«      Z3 G dR„ dSe«      Z4 G dT„ dUe«      Z5 G dV„ dWe5«      Z6 G dX„ dYe5«      Z7yZ)[zContains all custom errors.é    )ÚPath)Ú	HTTPErrorÚResponsec                   óD   ‡ — e Zd ZU dZeez  ed<   dedeez  fˆ fd„Zˆ xZS )ÚCacheNotFoundz9Exception thrown when the Huggingface cache is not found.Ú	cache_dirÚmsgc                 ó:   •— t        ‰| �  |g|¢­i |¤Ž || _        y ©N)ÚsuperÚ__init__r   )Úselfr	   r   ÚargsÚkwargsÚ	__class__s        €úX/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/huggingface_hub/errors.pyr   zCacheNotFound.__init__   s!   ø€ Ü‰Ñ˜Ð.˜tÒ. vÒ.Ø"ˆ�ó    )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústrr   Ú__annotations__r   Ú__classcell__©r   s   @r   r   r      s,   ø… ÙCà�T‰zÓð#˜Cð #¨C°$©J÷ #ñ #r   r   c                   ó   — e Zd ZdZy)ÚCorruptedCacheExceptionzGException for any unexpected structure in the Huggingface cache-system.N©r   r   r   r   © r   r   r   r      s   „ ÚQr   r   c                   ó   — e Zd ZdZy)ÚLocalTokenNotFoundErrorz0Raised if local token is required but not found.Nr   r   r   r   r!   r!      ó   „ Ú:r   r!   c                   ó   — e Zd ZdZy)ÚOfflineModeIsEnabledzTRaised when a request is made but `HF_HUB_OFFLINE=1` is set as environment variable.Nr   r   r   r   r$   r$   #   s   „ Ú^r   r$   c            	       óz   ‡ — e Zd ZdZddœdedededz  fˆ fd„Zded	dfd
„Zededededz  d	d fd„«       Z	d„ Z
ˆ xZS )ÚHfHubHTTPErrora>  
    HTTPError to inherit from for any custom HTTP Error raised in HF Hub.

    Any HTTPError is converted at least into a `HfHubHTTPError`. If some information is
    sent back by the server, it will be added to the error message.

    Added details:
    - Request ID sourced from headers in order of precedence: "X-Request-Id", "X-Amzn-Trace-Id", "X-Amz-Cf-Id".
    - Server error message from the header "X-Error-Message".
    - Server error message if we can found one in the response body.

    Example:
    ```py
        import httpx
        from huggingface_hub.utils import get_session, hf_raise_for_status, HfHubHTTPError

        response = get_session().post(...)
        try:
            hf_raise_for_status(response)
        except HfHubHTTPError as e:
            print(str(e)) # formatted message
            e.request_id, e.server_message # details returned by server

            # Complete the error message with additional information once it's raised
            e.append_to_message("
`create_commit` expects the repository to exist.")
            raise
    ```
    N)Úserver_messageÚmessageÚresponser'   c                ó  •— |j                   j                  d«      xs8 |j                   j                  d«      xs |j                   j                  d«      | _        || _        || _        |j
                  | _        t        ‰| �  |«       y )Nzx-request-idzX-Amzn-Trace-Idzx-amz-cf-id)ÚheadersÚgetÚ
request_idr'   r)   Úrequestr   r   )r   r(   r)   r'   r   s       €r   r   zHfHubHTTPError.__init__E   s~   ø€ ð ×Ñ× Ñ  Ó0ò 3Ø×Ñ×#Ñ#Ð$5Ó6ò3à×Ñ×#Ñ# MÓ2ð 	Œð
 -ˆÔØ ˆŒØ×'Ñ'ˆŒÜ‰Ñ˜Õ!r   Úadditional_messageÚreturnc                 óT   — | j                   d   |z   f| j                   dd z   | _         y)zFAppend additional information to the `HfHubHTTPError` initial message.r   é   N)r   )r   r/   s     r   Úappend_to_messagez HfHubHTTPError.append_to_messageV   s)   € à—Y‘Y˜q‘\Ð$6Ñ6Ð8¸4¿9¹9ÀQÀR¸=ÑHˆ�	r   c                 ó   —  | |||¬«      S )N)r)   r'   r   )Úclsr(   r)   r'   s       r   Ú_reconstruct_hf_hub_http_errorz-HfHubHTTPError._reconstruct_hf_hub_http_errorZ   s   € ñ �7 X¸nÔMÐMr   c                 ór   — | j                   j                  t        | «      | j                  | j                  ffS )zeFix pickling of Exception subclass with kwargs. We need to override __reduce_ex__ of the parent class)r   r6   r   r)   r'   )r   Úprotocols     r   Ú__reduce_ex__zHfHubHTTPError.__reduce_ex__`   s-   € à—‘×=Ñ=ÄÀDÃ	È4Ï=É=ÐZ^×ZmÑZmÐ?nÐoÐor   )r   r   r   r   r   r   r   r3   Úclassmethodr6   r9   r   r   s   @r   r&   r&   '   s�   ø„ ñðD &*ò"àð"ð ð	"ð
 ˜d™
õ"ð"I°Cð I¸Dó Ið ðNØðNØ%-ðNØ?BÀT¹zðNà	òNó ðNö
pr   r&   c                   ó   — e Zd ZdZy)ÚInferenceTimeoutErrorzBError raised when a model is unavailable or the request times out.Nr   r   r   r   r<   r<   h   s   „ ÚLr   r<   c                   ó   — e Zd ZdZy)ÚInferenceEndpointErrorz8Generic exception when dealing with Inference Endpoints.Nr   r   r   r   r>   r>   o   s   „ ÚBr   r>   c                   ó   — e Zd ZdZy)ÚInferenceEndpointTimeoutErrorz<Exception for timeouts while waiting for Inference Endpoint.Nr   r   r   r   r@   r@   s   s   „ ÚFr   r@   c                   ó   — e Zd ZdZy)ÚSafetensorsParsingErrorz¥Raised when failing to parse a safetensors file metadata.

    This can be the case if the file is not a safetensors file or does not respect the specification.
    Nr   r   r   r   rB   rB   z   ó   „ òr   rB   c                   ó   — e Zd ZdZy)ÚNotASafetensorsRepoErrorzŽRaised when a repo is not a Safetensors repo i.e. doesn't have either a `model.safetensors` or a
    `model.safetensors.index.json` file.
    Nr   r   r   r   rE   rE   �   s   „ òr   rE   c                   ó   — e Zd ZdZy)ÚTextGenerationErrorz3Generic error raised if text-generation went wrong.Nr   r   r   r   rG   rG   Š   ó   „ Ú=r   rG   c                   ó   — e Zd ZdZy)ÚValidationErrorzServer-side validation error.Nr   r   r   r   rJ   rJ   �   s   „ Ú'r   rJ   c                   ó   — e Zd Zy)ÚGenerationErrorN©r   r   r   r   r   r   rL   rL   “   ó   „ Ør   rL   c                   ó   — e Zd Zy)ÚOverloadedErrorNrM   r   r   r   rP   rP   —   rN   r   rP   c                   ó   — e Zd Zy)ÚIncompleteGenerationErrorNrM   r   r   r   rR   rR   ›   rN   r   rR   c                   ó   — e Zd Zy)ÚUnknownErrorNrM   r   r   r   rT   rT   Ÿ   rN   r   rT   c                   ó   — e Zd ZdZy)ÚHFValidationErrorzŸGeneric exception thrown by `huggingface_hub` validators.

    Inherits from [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError).
    Nr   r   r   r   rV   rV   ¦   rC   r   rV   c                   ó   — e Zd ZdZy)ÚDryRunErrorzXError triggered when a dry run is requested but cannot be performed (e.g. invalid repo).Nr   r   r   r   rX   rX   °   ó   „ Úbr   rX   c                   ó   — e Zd ZdZy)ÚFileMetadataErrorz§Error triggered when the metadata of a file on the Hub cannot be retrieved (missing ETag or commit_hash).

    Inherits from `OSError` for backward compatibility.
    Nr   r   r   r   r[   r[   ´   rC   r   r[   c                   ó&   — e Zd ZU dZdZedz  ed<   y)ÚBucketNotFoundErroraÍ  
    Raised when trying to access a bucket that does not exist.

    Attributes:
        bucket_id (`str` or `None`):
            The bucket id (namespace/name) that was not found, if it could be determined from the request URL.

    Example:

    ```py
    >>> from huggingface_hub import bucket_info
    >>> bucket_info("<non_existent_bucket>")
    (...)
    huggingface_hub.errors.BucketNotFoundError: 404 Client Error. (Request ID: XXX)

    Bucket Not Found for url: https://huggingface.co/api/buckets/namespace/name.
    Please make sure you specified the correct bucket id (namespace/name).
    If the bucket is private, make sure you are authenticated and your token has the required permissions.
    ```
    NÚ	bucket_id)r   r   r   r   r^   r   r   r   r   r   r]   r]   ¾   s   … ñð* !€Iˆs�T‰zÔ r   r]   c                   ó:   — e Zd ZU dZdZedz  ed<   dZedz  ed<   y)ÚRepositoryNotFoundErroraã  
    Raised when trying to access a hf.co URL with an invalid repository name, or
    with a private repo name the user does not have access to.

    Attributes:
        repo_id (`str` or `None`):
            The repo id that was not found, if it could be determined from the request URL.
        repo_type (`str` or `None`):
            The repo type ("model", "dataset", or "space"), if it could be determined from the request URL.

    Example:

    ```py
    >>> from huggingface_hub import model_info
    >>> model_info("<non_existent_repository>")
    (...)
    huggingface_hub.errors.RepositoryNotFoundError: 401 Client Error. (Request ID: PvMw_VjBMjVdMz53WKIzP)

    Repository Not Found for url: https://huggingface.co/api/models/%3Cnon_existent_repository%3E.
    Please make sure you specified the correct `repo_id` and `repo_type`.
    If the repo is private, make sure you are authenticated and your token has the required permissions.
    Invalid username or password.
    ```
    NÚrepo_idÚ	repo_type©r   r   r   r   ra   r   r   rb   r   r   r   r`   r`   Ú   s%   … ñð2 €GˆS�4‰ZÓØ €Iˆs�T‰zÔ r   r`   c                   ó   — e Zd ZdZy)ÚGatedRepoErrora¿  
    Raised when trying to access a gated repository for which the user is not on the
    authorized list.

    Note: derives from `RepositoryNotFoundError` to ensure backward compatibility.

    Example:

    ```py
    >>> from huggingface_hub import model_info
    >>> model_info("<gated_repository>")
    (...)
    huggingface_hub.errors.GatedRepoError: 403 Client Error. (Request ID: ViT1Bf7O_026LGSQuVqfa)

    Cannot access gated repo for url https://huggingface.co/api/models/ardent-figment/gated-model.
    Access to model ardent-figment/gated-model is restricted and you are not in the authorized list.
    Visit https://huggingface.co/ardent-figment/gated-model to ask for access.
    ```
    Nr   r   r   r   re   re   ø   s   „ òr   re   c                   ó   — e Zd ZdZy)ÚDisabledRepoErroraý  
    Raised when trying to access a repository that has been disabled by its author.

    Example:

    ```py
    >>> from huggingface_hub import dataset_info
    >>> dataset_info("laion/laion-art")
    (...)
    huggingface_hub.errors.DisabledRepoError: 403 Client Error. (Request ID: Root=1-659fc3fa-3031673e0f92c71a2260dbe2;bc6f4dfb-b30a-4862-af0a-5cfe827610d8)

    Cannot access repository for url https://huggingface.co/api/datasets/laion/laion-art.
    Access to this resource is disabled.
    ```
    Nr   r   r   r   rg   rg     ó   „ òr   rg   c                   ó:   — e Zd ZU dZdZedz  ed<   dZedz  ed<   y)ÚRevisionNotFoundErrora  
    Raised when trying to access a hf.co URL with a valid repository but an invalid
    revision.

    Attributes:
        repo_id (`str` or `None`):
            The repo id, if it could be determined from the request URL.
        repo_type (`str` or `None`):
            The repo type ("model", "dataset", or "space"), if it could be determined from the request URL.

    Example:

    ```py
    >>> from huggingface_hub import hf_hub_download
    >>> hf_hub_download('bert-base-cased', 'config.json', revision='<non-existent-revision>')
    (...)
    huggingface_hub.errors.RevisionNotFoundError: 404 Client Error. (Request ID: Mwhe_c3Kt650GcdKEFomX)

    Revision Not Found for url: https://huggingface.co/bert-base-cased/resolve/%3Cnon-existent-revision%3E/config.json.
    ```
    Nra   rb   rc   r   r   r   rj   rj   #  ó%   … ñð, €GˆS�4‰ZÓØ €Iˆs�T‰zÔ r   rj   c                   ó   — e Zd ZdZy)ÚEntryNotFoundErrora¿  
    Raised when entry not found, either locally or remotely.

    Example:

    ```py
    >>> from huggingface_hub import hf_hub_download
    >>> hf_hub_download('bert-base-cased', '<non-existent-file>')
    (...)
    huggingface_hub.errors.RemoteEntryNotFoundError (...)
    >>> hf_hub_download('bert-base-cased', '<non-existent-file>', local_files_only=True)
    (...)
    huggingface_hub.utils.errors.LocalEntryNotFoundError (...)
    ```
    Nr   r   r   r   rm   rm   ?  rh   r   rm   c                   ó:   — e Zd ZU dZdZedz  ed<   dZedz  ed<   y)ÚRemoteEntryNotFoundErroraó  
    Raised when trying to access a hf.co URL with a valid repository and revision
    but an invalid filename.

    Attributes:
        repo_id (`str` or `None`):
            The repo id, if it could be determined from the request URL.
        repo_type (`str` or `None`):
            The repo type ("model", "dataset", or "space"), if it could be determined from the request URL.

    Example:

    ```py
    >>> from huggingface_hub import hf_hub_download
    >>> hf_hub_download('bert-base-cased', '<non-existent-file>')
    (...)
    huggingface_hub.errors.EntryNotFoundError: 404 Client Error. (Request ID: 53pNl6M0MxsnG5Sw8JA6x)

    Entry Not Found for url: https://huggingface.co/bert-base-cased/resolve/main/%3Cnon-existent-file%3E.
    ```
    Nra   rb   rc   r   r   r   ro   ro   Q  rk   r   ro   c                   ó(   ‡ — e Zd ZdZdefˆ fd„Zˆ xZS )ÚLocalEntryNotFoundErroraF  
    Raised when trying to access a file or snapshot that is not on the disk when network is
    disabled or unavailable (connection issue). The entry may exist on the Hub.

    Example:

    ```py
    >>> from huggingface_hub import hf_hub_download
    >>> hf_hub_download('bert-base-cased', '<non-cached-file>',  local_files_only=True)
    (...)
    huggingface_hub.errors.LocalEntryNotFoundError: Cannot find the requested files in the disk cache and outgoing traffic has been disabled. To enable hf.co look-ups and downloads online, set 'local_files_only' to False.
    ```
    r(   c                 ó$   •— t         ‰| �  |«       y r   )r   r   )r   r(   r   s     €r   r   z LocalEntryNotFoundError.__init__{  s   ø€ Ü‰Ñ˜Õ!r   )r   r   r   r   r   r   r   r   s   @r   rq   rq   l  s   ø„ ñð" ÷ "ñ "r   rq   c                   ó   — e Zd ZdZy)ÚBadRequestErroraG  
    Raised by `hf_raise_for_status` when the server returns a HTTP 400 error.

    Example:

    ```py
    >>> resp = httpx.post("hf.co/api/check", ...)
    >>> hf_raise_for_status(resp, endpoint_name="check")
    huggingface_hub.errors.BadRequestError: Bad request for check endpoint: {details} (Request ID: XXX)
    ```
    Nr   r   r   r   rt   rt   €  s   „ ò
r   rt   c                   ó   — e Zd ZdZy)Ú	DDUFErrorz5Base exception for errors related to the DDUF format.Nr   r   r   r   rv   rv   ‘  s   „ Ú?r   rv   c                   ó   — e Zd ZdZy)ÚDDUFCorruptedFileErrorz1Exception thrown when the DDUF file is corrupted.Nr   r   r   r   rx   rx   •  ó   „ Ú;r   rx   c                   ó   — e Zd ZdZy)ÚDDUFExportErrorz-Base exception for errors during DDUF export.Nr   r   r   r   r{   r{   ™  s   „ Ú7r   r{   c                   ó   — e Zd ZdZy)ÚDDUFInvalidEntryNameErrorz0Exception thrown when the entry name is invalid.Nr   r   r   r   r}   r}   �  r"   r   r}   c                   ó   — e Zd ZdZy)ÚStrictDataclassErrorz&Base exception for strict dataclasses.Nr   r   r   r   r   r   ¤  s   „ Ú0r   r   c                   ó   — e Zd ZdZy)ÚStrictDataclassDefinitionErrorz@Exception thrown when a strict dataclass is defined incorrectly.Nr   r   r   r   r�   r�   ¨  s   „ ÚJr   r�   c                   ó,   ‡ — e Zd ZdZdedefˆ fd„Zˆ xZS )Ú#StrictDataclassFieldValidationErrorzLException thrown when a strict dataclass fails validation for a given field.ÚfieldÚcausec                 ón   •— d|› d�}|d|j                   j                  › d|› �z  }t        ‰| �  |«       y )NzValidation error for field 'ú':ú
    ú: ©r   r   r   r   )r   r„   r…   Úerror_messager   s       €r   r   z,StrictDataclassFieldValidationError.__init__¯  s@   ø€ Ø6°u°g¸RÐ@ˆØ˜6 %§/¡/×":Ñ":Ð!;¸2¸e¸WÐEÑEˆÜ‰Ñ˜Õ'r   ©r   r   r   r   r   Ú	Exceptionr   r   r   s   @r   rƒ   rƒ   ¬  s   ø„ ÙVð(˜cð (¨)÷ (ñ (r   rƒ   c                   ó,   ‡ — e Zd ZdZdedefˆ fd„Zˆ xZS )Ú#StrictDataclassClassValidationErrorzOException thrown when a strict dataclass fails validation on a class validator.Ú	validatorr…   c                 ón   •— d|› d�}|d|j                   j                  › d|› �z  }t        ‰| �  |«       y )Nz&Class validation error for validator 'r‡   rˆ   r‰   rŠ   )r   r�   r…   r‹   r   s       €r   r   z,StrictDataclassClassValidationError.__init__¸  s@   ø€ Ø@ÀÀÈ2ÐNˆØ˜6 %§/¡/×":Ñ":Ð!;¸2¸e¸WÐEÑEˆÜ‰Ñ˜Õ'r   rŒ   r   s   @r   r�   r�   µ  s   ø„ ÙYð( #ð (¨i÷ (ñ (r   r�   c                   ó   — e Zd ZdZy)ÚXetErrorz1Base exception for errors related to Xet Storage.Nr   r   r   r   r“   r“   Á  ry   r   r“   c                   ó   — e Zd ZdZy)ÚXetAuthorizationErrorzXException thrown when the user does not have the right authorization to use Xet Storage.Nr   r   r   r   r•   r•   Å  rY   r   r•   c                   ó   — e Zd ZdZy)ÚXetRefreshTokenErrorz3Exception thrown when the refresh token is invalid.Nr   r   r   r   r—   r—   É  rH   r   r—   c                   ó   — e Zd ZdZy)ÚXetDownloadErrorz:Exception thrown when the download from Xet Storage fails.Nr   r   r   r   r™   r™   Í  s   „ ÚDr   r™   c                   ó   — e Zd ZdZy)ÚCLIErrorz7CLI error with clean message (no traceback by default).Nr   r   r   r   r›   r›   Ô  s   „ ÚAr   r›   c                   ó   — e Zd ZdZy)ÚConfirmationErrorzERaised when a confirmation prompt is declined (non-interactive mode).Nr   r   r   r   r�   r�   Ø  s   „ ÚOr   r�   c                   ó   — e Zd ZdZy)ÚCLIExtensionInstallErrorz(Error during CLI extension installation.Nr   r   r   r   rŸ   rŸ   Ü  s   „ Ú2r   rŸ   N)8r   Úpathlibr   Úhttpxr   r   r�   r   r   ÚEnvironmentErrorr!   ÚConnectionErrorr$   ÚOSErrorr&   ÚTimeoutErrorr<   r>   r@   rB   rE   rG   rJ   rL   rP   rR   rT   Ú
ValueErrorrV   rX   r[   r]   r`   re   rg   rj   rm   ro   ÚFileNotFoundErrorrq   rt   rv   rx   r{   r}   r   r�   rƒ   r�   r“   r•   r—   r™   r›   r�   rŸ   r   r   r   ú<module>r¨      sG  ðÙ !å ç %ô#�Iô #ôR˜iô Rô;Ð.ô ;ô_˜?ô _ô;p�Y ô ;pôBM˜I |ô MôC˜Yô CôGÐ$:¸Lô Gô˜iô ô˜yô ô>˜)ô >ô
(Ð)ô (ô	Ð)ô 	ô	Ð)ô 	ô	Ð 3ô 	ô	Ð&ô 	ô˜
ô ôc�'ô cô˜ô ô!˜.ô !ô8!˜nô !ô<Ð,ô ô,˜ô ô*!˜Nô !ô8˜ô ô$!˜~Ð/Aô !ô6"Ð/Ð1Cô "ô(�n jô ô"@�	ô @ô<˜Yô <ô8�iô 8ô; ô ;ô1˜9ô 1ôKÐ%9ô Kô(Ð*>ô (ô(Ð*>ô (ô<ˆyô <ôc˜Hô cô>˜8ô >ôE�yô EôBˆyô BôP˜ô Pô3˜xõ 3r   