§
    «˜ºhÁ+  ã                   óL  — d Z ddlmZ ddlmZ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¦  «        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/„ d0e¦  «        Z$ G d1„ d2e¦  «        Z% G d3„ d4e%e&e¦  «        Z' G d5„ d6ee¦  «        Z( G d7„ d8e	¦  «        Z) G d9„ d:e)¦  «        Z* G d;„ d<e)¦  «        Z+ G d=„ d>e+¦  «        Z, G d?„ d@e	¦  «        Z- G dA„ dBe-¦  «        Z. G dC„ dDe-¦  «        Z/ G dE„ dFe-¦  «        Z0 G dG„ dHe	¦  «        Z1 G dI„ dJe1¦  «        Z2 G dK„ dLe1¦  «        Z3 G dM„ dNe	¦  «        Z4dOS )PzContains all custom errors.é    )ÚPath)ÚOptionalÚUnion)Ú	HTTPErrorÚResponsec                   óX   ‡ — e Zd ZU dZeeef         ed<   dedeeef         fˆ fd„Zˆ xZ	S )ÚCacheNotFoundz9Exception thrown when the Huggingface cache is not found.Ú	cache_dirÚmsgc                 óP   •—  t          ¦   «         j        |g|¢R i |¤Ž || _        d S ©N)ÚsuperÚ__init__r
   )Úselfr   r
   ÚargsÚkwargsÚ	__class__s        €ú^/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/huggingface_hub/errors.pyr   zCacheNotFound.__init__   s5   ø€ Ø�‰ŒÔ˜Ð.˜tÐ.Ð.Ð. vÐ.Ð.Ð.Ø"ˆŒˆˆó    )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ústrr   Ú__annotations__r   Ú__classcell__©r   s   @r   r	   r	      sq   ø€ € € € € € ØCÐCà�S˜$�YÔÐÐÑð#˜Cð #¨E°#°t°)Ô,<ð #ð #ð #ð #ð #ð #ð #ð #ð #ð #r   r	   c                   ó   — e Zd ZdZdS )ÚCorruptedCacheExceptionzGException for any unexpected structure in the Huggingface cache-system.N©r   r   r   r   © r   r   r   r      s   € € € € € ØQÐQÐQÐQr   r   c                   ó   — e Zd ZdZdS )ÚLocalTokenNotFoundErrorz0Raised if local token is required but not found.Nr    r!   r   r   r#   r#      ó   € € € € € Ø:Ð:Ð:Ð:r   r#   c                   ó   — e Zd ZdZdS )Ú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            	       ó`   ‡ — e Zd ZdZdddœdedee         dee         fˆ fd„Zded	df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 from "X-Request-Id" header if exists. If not, fallback to "X-Amzn-Trace-Id" header if exists.
    - Server error message from the header "X-Error-Message".
    - Server error message if we can found one in the response body.

    Example:
    ```py
        import requests
        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                óê   •— |�4|j                              d¦  «        p|j                              d¦  «        nd | _        || _        t	          ¦   «                              |||�|j        nd ¬¦  «         d S )Nzx-request-idzX-Amzn-Trace-Id)r+   Úrequest)ÚheadersÚgetÚ
request_idr)   r   r   r-   )r   r*   r+   r)   r   s       €r   r   zHfHubHTTPError.__init__F   sŽ   ø€ ð Ð#ð Ô× Ò  Ñ0Ô0Ð[°HÔ4D×4HÒ4HÐIZÑ4[Ô4[øàð 	Œð
 -ˆÔå‰Œ×ÒØØØ(0Ð(<�HÔ$Ð$À$ð 	ñ 	
ô 	
ð 	
ð 	
ð 	
r   Úadditional_messageÚreturnc                 óR   — | j         d         |z   f| j         dd…         z   | _         dS )zFAppend additional information to the `HfHubHTTPError` initial message.r   é   N)r   )r   r1   s     r   Úappend_to_messagez HfHubHTTPError.append_to_messageT   s+   € à”Y˜q”\Ð$6Ñ6Ð8¸4¼9ÀQÀRÀR¼=ÑHˆŒ	ˆ	ˆ	r   r   )
r   r   r   r   r   r   r   r   r5   r   r   s   @r   r(   r(   (   s¦   ø€ € € € € ðð ð:
Ðmqð 
ð 
ð 
 ð 
¨x¸Ô/Að 
Ð]eÐfiÔ]jð 
ð 
ð 
ð 
ð 
ð 
ðI°Cð I¸Dð Ið Ið Ið Ið Ið Ið Ið Ir   r(   c                   ó   — e Zd ZdZdS )ÚInferenceTimeoutErrorzBError raised when a model is unavailable or the request times out.Nr    r!   r   r   r7   r7   \   s   € € € € € ØLÐLÐLÐLr   r7   c                   ó   — e Zd ZdZdS )ÚInferenceEndpointErrorz8Generic exception when dealing with Inference Endpoints.Nr    r!   r   r   r9   r9   c   s   € € € € € ØBÐBÐBÐBr   r9   c                   ó   — e Zd ZdZdS )ÚInferenceEndpointTimeoutErrorz<Exception for timeouts while waiting for Inference Endpoint.Nr    r!   r   r   r;   r;   g   s   € € € € € ØFÐFÐFÐFr   r;   c                   ó   — e Zd ZdZdS )Ú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   r=   r=   n   ó   € € € € € ðð ð ð r   r=   c                   ó   — e Zd ZdZdS )Ú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   r@   r@   u   s   € € € € € ðð ð ð r   r@   c                   ó   — e Zd ZdZdS )ÚTextGenerationErrorz3Generic error raised if text-generation went wrong.Nr    r!   r   r   rB   rB   ~   ó   € € € € € Ø=Ð=Ð=Ð=r   rB   c                   ó   — e Zd ZdZdS )ÚValidationErrorzServer-side validation error.Nr    r!   r   r   rE   rE   ƒ   s   € € € € € Ø'Ð'Ð'Ð'r   rE   c                   ó   — e Zd ZdS )ÚGenerationErrorN©r   r   r   r!   r   r   rG   rG   ‡   ó   € € € € € Ø€Dr   rG   c                   ó   — e Zd ZdS )ÚOverloadedErrorNrH   r!   r   r   rK   rK   ‹   rI   r   rK   c                   ó   — e Zd ZdS )ÚIncompleteGenerationErrorNrH   r!   r   r   rM   rM   �   rI   r   rM   c                   ó   — e Zd ZdS )ÚUnknownErrorNrH   r!   r   r   rO   rO   “   rI   r   rO   c                   ó   — e Zd ZdZdS )ÚHFValidationErrorzŸGeneric exception thrown by `huggingface_hub` validators.

    Inherits from [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError).
    Nr    r!   r   r   rQ   rQ   š   r>   r   rQ   c                   ó   — e Zd ZdZdS )Ú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   rS   rS   ¤   r>   r   rS   c                   ó   — e Zd ZdZdS )Ú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.

    Example:

    ```py
    >>> from huggingface_hub import model_info
    >>> model_info("<non_existent_repository>")
    (...)
    huggingface_hub.utils._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.
    Invalid username or password.
    ```
    Nr    r!   r   r   rU   rU   ®   s   € € € € € ðð ð ð r   rU   c                   ó   — e Zd ZdZdS )Ú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.utils._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   rW   rW   Ã   s   € € € € € ðð ð ð r   rW   c                   ó   — e Zd ZdZdS )Ú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.utils._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   rY   rY   Ù   ó   € € € € € ðð ð ð r   rY   c                   ó   — e Zd ZdZdS )ÚRevisionNotFoundErrora  
    Raised when trying to access a hf.co URL with a valid repository but an invalid
    revision.

    Example:

    ```py
    >>> from huggingface_hub import hf_hub_download
    >>> hf_hub_download('bert-base-cased', 'config.json', revision='<non-existent-revision>')
    (...)
    huggingface_hub.utils._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.
    ```
    Nr    r!   r   r   r\   r\   î   rZ   r   r\   c                   ó   — e Zd ZdZdS )ÚEntryNotFoundErroraì  
    Raised when trying to access a hf.co URL with a valid repository and revision
    but an invalid filename.

    Example:

    ```py
    >>> from huggingface_hub import hf_hub_download
    >>> hf_hub_download('bert-base-cased', '<non-existent-file>')
    (...)
    huggingface_hub.utils._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.
    ```
    Nr    r!   r   r   r^   r^     rZ   r   r^   c                   ó(   ‡ — e Zd ZdZdefˆ fd„Zˆ xZS )ÚLocalEntryNotFoundErrora  
    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.

    Note: `ValueError` type is to ensure backward compatibility.
    Note: `LocalEntryNotFoundError` derives from `HTTPError` because of `EntryNotFoundError`
          even when it is not a network issue.

    Example:

    ```py
    >>> from huggingface_hub import hf_hub_download
    >>> hf_hub_download('bert-base-cased', '<non-cached-file>',  local_files_only=True)
    (...)
    huggingface_hub.utils._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                 óN   •— t          ¦   «                              |d ¬¦  «         d S )N)r+   )r   r   )r   r*   r   s     €r   r   z LocalEntryNotFoundError.__init__&  s&   ø€ Ý‰Œ×Ò˜¨4ÐÑ0Ô0Ð0Ð0Ð0r   )r   r   r   r   r   r   r   r   s   @r   r`   r`     sN   ø€ € € € € ðð ð$1 ð 1ð 1ð 1ð 1ð 1ð 1ð 1ð 1ð 1ð 1r   r`   c                   ó   — e Zd ZdZdS )ÚBadRequestErroraQ  
    Raised by `hf_raise_for_status` when the server returns a HTTP 400 error.

    Example:

    ```py
    >>> resp = requests.post("hf.co/api/check", ...)
    >>> hf_raise_for_status(resp, endpoint_name="check")
    huggingface_hub.utils._errors.BadRequestError: Bad request for check endpoint: {details} (Request ID: XXX)
    ```
    Nr    r!   r   r   rc   rc   +  s   € € € € € ð
ð 
ð 
ð 
r   rc   c                   ó   — e Zd ZdZdS )Ú	DDUFErrorz5Base exception for errors related to the DDUF format.Nr    r!   r   r   re   re   <  s   € € € € € Ø?Ð?Ð?Ð?r   re   c                   ó   — e Zd ZdZdS )ÚDDUFCorruptedFileErrorz1Exception thrown when the DDUF file is corrupted.Nr    r!   r   r   rg   rg   @  ó   € € € € € Ø;Ð;Ð;Ð;r   rg   c                   ó   — e Zd ZdZdS )ÚDDUFExportErrorz-Base exception for errors during DDUF export.Nr    r!   r   r   rj   rj   D  s   € € € € € Ø7Ð7Ð7Ð7r   rj   c                   ó   — e Zd ZdZdS )ÚDDUFInvalidEntryNameErrorz0Exception thrown when the entry name is invalid.Nr    r!   r   r   rl   rl   H  r$   r   rl   c                   ó   — e Zd ZdZdS )ÚStrictDataclassErrorz&Base exception for strict dataclasses.Nr    r!   r   r   rn   rn   O  s   € € € € € Ø0Ð0Ð0Ð0r   rn   c                   ó   — e Zd ZdZdS )ÚStrictDataclassDefinitionErrorz@Exception thrown when a strict dataclass is defined incorrectly.Nr    r!   r   r   rp   rp   S  s   € € € € € ØJÐJÐJÐJr   rp   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                 ó€   •— d|› d�}|d|j         j        › d|› �z  }t          ¦   «                              |¦  «         d S )NzValidation error for field 'ú':ú
    ú: ©r   r   r   r   )r   rs   rt   Úerror_messager   s       €r   r   z,StrictDataclassFieldValidationError.__init__Z  sQ   ø€ Ø@°uÐ@Ð@Ð@ˆØÐE %¤/Ô":ÐEÐE¸eÐEÐEÑEˆÝ‰Œ×Ò˜Ñ'Ô'Ð'Ð'Ð'r   ©r   r   r   r   r   Ú	Exceptionr   r   r   s   @r   rr   rr   W  sQ   ø€ € € € € ØVÐVð(˜cð (¨)ð (ð (ð (ð (ð (ð (ð (ð (ð (ð (r   rr   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.Ú	validatorrt   c                 ó€   •— d|› d�}|d|j         j        › d|› �z  }t          ¦   «                              |¦  «         d S )Nz&Class validation error for validator 'rv   rw   rx   ry   )r   r   rt   rz   r   s       €r   r   z,StrictDataclassClassValidationError.__init__c  sQ   ø€ ØNÀÐNÐNÐNˆØÐE %¤/Ô":ÐEÐE¸eÐEÐEÑEˆÝ‰Œ×Ò˜Ñ'Ô'Ð'Ð'Ð'r   r{   r   s   @r   r~   r~   `  sQ   ø€ € € € € ØYÐYð( #ð (¨ið (ð (ð (ð (ð (ð (ð (ð (ð (ð (r   r~   c                   ó   — e Zd ZdZdS )ÚXetErrorz1Base exception for errors related to Xet Storage.Nr    r!   r   r   r‚   r‚   l  rh   r   r‚   c                   ó   — e Zd ZdZdS )ÚXetAuthorizationErrorzXException thrown when the user does not have the right authorization to use Xet Storage.Nr    r!   r   r   r„   r„   p  s   € € € € € ØbÐbÐbÐbr   r„   c                   ó   — e Zd ZdZdS )ÚXetRefreshTokenErrorz3Exception thrown when the refresh token is invalid.Nr    r!   r   r   r†   r†   t  rC   r   r†   c                   ó   — e Zd ZdZdS )ÚXetDownloadErrorz:Exception thrown when the download from Xet Storage fails.Nr    r!   r   r   rˆ   rˆ   x  s   € € € € € ØDÐDÐDÐDr   rˆ   N)5r   Úpathlibr   Útypingr   r   Úrequestsr   r   r|   r	   r   ÚEnvironmentErrorr#   ÚConnectionErrorr&   r(   ÚTimeoutErrorr7   r9   r;   r=   r@   rB   rE   rG   rK   rM   rO   Ú
ValueErrorrQ   ÚOSErrorrS   rU   rW   rY   r\   r^   ÚFileNotFoundErrorr`   rc   re   rg   rj   rl   rn   rp   rr   r~   r‚   r„   r†   rˆ   r!   r   r   ú<module>r’      sÓ  ðØ !Ð !à Ð Ð Ð Ð Ð Ø "Ð "Ð "Ð "Ð "Ð "Ð "Ð "à (Ð (Ð (Ð (Ð (Ð (Ð (Ð (ð#ð #ð #ð #ð #�Iñ #ô #ð #ðRð Rð Rð Rð R˜iñ Rô Rð Rð;ð ;ð ;ð ;ð ;Ð.ñ ;ô ;ð ;ð_ð _ð _ð _ð _˜?ñ _ô _ð _ð.Ið .Ið .Ið .Ið .I�Yñ .Iô .Ið .IðhMð Mð Mð Mð M˜I |ñ Mô Mð MðCð Cð Cð Cð C˜Yñ Cô Cð CðGð Gð Gð Gð GÐ$:¸Lñ Gô Gð Gðð ð ð ð ˜iñ ô ð ðð ð ð ð ˜yñ ô ð ð>ð >ð >ð >ð >˜)ñ >ô >ð >ð
(ð (ð (ð (ð (Ð)ñ (ô (ð (ð	ð 	ð 	ð 	ð 	Ð)ñ 	ô 	ð 	ð	ð 	ð 	ð 	ð 	Ð)ñ 	ô 	ð 	ð	ð 	ð 	ð 	ð 	Ð 3ñ 	ô 	ð 	ð	ð 	ð 	ð 	ð 	Ð&ñ 	ô 	ð 	ðð ð ð ð ˜
ñ ô ð ðð ð ð ð ˜ñ ô ð ðð ð ð ð ˜nñ ô ð ð*ð ð ð ð Ð,ñ ô ð ð,ð ð ð ð ˜ñ ô ð ð*ð ð ð ð ˜Nñ ô ð ð&ð ð ð ð ˜ñ ô ð ð$1ð 1ð 1ð 1ð 1Ð0Ð2CÀZñ 1ô 1ð 1ð0ð ð ð ð �n jñ ô ð ð"@ð @ð @ð @ð @�	ñ @ô @ð @ð<ð <ð <ð <ð <˜Yñ <ô <ð <ð8ð 8ð 8ð 8ð 8�iñ 8ô 8ð 8ð;ð ;ð ;ð ;ð ; ñ ;ô ;ð ;ð1ð 1ð 1ð 1ð 1˜9ñ 1ô 1ð 1ðKð Kð Kð Kð KÐ%9ñ Kô Kð Kð(ð (ð (ð (ð (Ð*>ñ (ô (ð (ð(ð (ð (ð (ð (Ð*>ñ (ô (ð (ð<ð <ð <ð <ð <ˆyñ <ô <ð <ðcð cð cð cð c˜Hñ cô cð cð>ð >ð >ð >ð >˜8ñ >ô >ð >ðEð Eð Eð Eð E�yñ Eô Eð Eð Eð Er   