Ë
    Bêñië+  ã                   ó  — d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ  G d„ de	e«      Z
 G d„ d	e	e«      Z G d
„ de	e«      Ze G d„ d«      «       Ze G d„ d«      «       Ze G d„ d«      «       Ze G d„ d«      «       Ze G d„ d«      «       Zy)é    )Ú	dataclass)Údatetime)ÚEnum)ÚLiteral)Úparse_datetimec                   ó@   — e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZy)Ú
SpaceStagea  
    Enumeration of possible stage of a Space on the Hub.

    Value can be compared to a string:
    ```py
    assert SpaceStage.BUILDING == "BUILDING"
    ```

    Taken from https://github.com/huggingface/moon-landing/blob/main/server/repo_types/SpaceInfo.ts#L61 (private url).
    ÚNO_APP_FILEÚCONFIG_ERRORÚBUILDINGÚBUILD_ERRORÚRUNNINGÚRUNNING_BUILDINGÚRUNTIME_ERRORÚDELETINGÚSTOPPEDÚPAUSEDÚAPP_STARTINGÚRUNNING_APP_STARTINGN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   r   r   r   r   r   r   r   r   r   r   © ó    ú\/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/huggingface_hub/_space_api.pyr	   r	      sG   „ ñ	ð  €KØ!€LØ€HØ€KØ€GØ)ÐØ#€MØ€HØ€GØ€FØ!€LØ1Ñr   r	   c                   ót   — e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZy)ÚSpaceHardwarea=  
    Enumeration of hardwares available to run your Space on the Hub.

    Value can be compared to a string:
    ```py
    assert SpaceHardware.CPU_BASIC == "cpu-basic"
    ```

    Taken from https://github.com/huggingface-internal/moon-landing/blob/main/server/repo_types/SpaceHardwareFlavor.ts (private url).
    z	cpu-basiczcpu-upgradezcpu-performancezcpu-xlÚsprx8z	zero-a10gzt4-smallz	t4-mediumÚl4x1Úl4x4Úl40sx1Úl40sx4Úl40sx8z
a10g-smallz
a10g-largeza10g-largex2za10g-largex4z
a100-largeÚa100x4Úa100x8Úh200Úh200x2Úh200x4Úh200x8Úinf2x6N)r   r   r   r   Ú	CPU_BASICÚCPU_UPGRADEÚCPU_PERFORMANCEÚCPU_XLÚSPRX8Ú	ZERO_A10GÚT4_SMALLÚ	T4_MEDIUMÚL4X1ÚL4X4ÚL40SX1ÚL40SX4ÚL40SX8Ú
A10G_SMALLÚ
A10G_LARGEÚA10G_LARGEX2ÚA10G_LARGEX4Ú
A100_LARGEÚA100X4ÚA100X8ÚH200ÚH200X2ÚH200X4ÚH200X8ÚINF2X6r   r   r   r   r   1   sŒ   „ ñ	ð €IØ€KØ'€OØ€FØ€Eð €Ið €HØ€IØ€DØ€DØ€FØ€FØ€FØ€JØ€JØ!€LØ!€LØ€JØ€FØ€FØ€DØ€FØ€FØ€Fð �Fr   r   c                   ó   — e Zd ZdZdZdZdZy)ÚSpaceStoragea5  
    Enumeration of persistent storage available for your Space on the Hub.

    Value can be compared to a string:
    ```py
    assert SpaceStorage.SMALL == "small"
    ```

    Taken from https://github.com/huggingface/moon-landing/blob/main/server/repo_types/SpaceHardwareFlavor.ts#L24 (private url).
    ÚsmallÚmediumÚlargeN)r   r   r   r   ÚSMALLÚMEDIUMÚLARGEr   r   r   rF   rF   _   s   „ ñ	ð €EØ€FØ�Er   rF   c                   ó’   — e Zd ZU dZed   ed<   eed<   eed<   dZedz  ed<   dZe	dz  ed<   dZ
edz  ed	<   dd„Zd
efd„Zd
efd„Zy)ÚVolumeaâ  
    Describes a volume to mount in a Space or Job container.

    Args:
        type (`str`):
            Type of volume: `"bucket"`, `"model"`, `"dataset"`, or `"space"`.
        source (`str`):
            Source identifier, e.g. `"username/my-bucket"` or `"username/my-model"`.
        mount_path (`str`):
            Mount path inside the container, e.g. `"/data"`. Must start with `/`.
        revision (`str` or `None`):
            Git revision (only for repos, defaults to `"main"`).
        read_only (`bool` or `None`):
            Read-only mount. Forced `True` for repos, defaults to `False` for buckets.
        path (`str` or `None`):
            Subfolder prefix inside the bucket/repo to mount, e.g. `"path/to/dir"`.
    )ÚbucketÚmodelÚdatasetÚspaceÚtypeÚsourceÚ
mount_pathNÚrevisionÚ	read_onlyÚpathÚreturnc                 ó2  — |j                  dd«      | _        |d   | _        |j                  d«      }|�|n|d   | _        |j                  d«      | _        |j                  d«      }|�|n|j                  d«      | _        |j                  d	«      | _        y )
NrS   rP   rT   Ú	mountPathrU   rV   ÚreadOnlyrW   rX   )ÚgetrS   rT   rU   rV   rW   rX   )ÚselfÚkwargsrU   rW   s       r   Ú__init__zVolume.__init__‹   s†   € Ø—J‘J˜v wÓ/ˆŒ	Ø˜XÑ&ˆŒØ—Z‘Z Ó,ˆ
Ø(2Ð(>™*ÀFÈ<ÑDXˆŒØŸ
™
 :Ó.ˆŒØ—J‘J˜zÓ*ˆ	Ø&/Ð&;™ÀÇÁÈKÓAXˆŒØ—J‘J˜vÓ&ˆ�	r   c                 óð   — | j                   | j                  | j                  dœ}| j                  �| j                  |d<   | j                  �| j                  |d<   | j
                  �| j
                  |d<   |S )z6Serialize to the JSON payload expected by the Hub API.)rS   rT   r[   rV   r\   rX   )rS   rT   rU   rV   rW   rX   ©r^   Údatas     r   Úto_dictzVolume.to_dict•   sn   € ð —I‘IØ—k‘kØŸ™ñ
ˆð
 �=‰=Ð$Ø#Ÿ}™}ˆD�ÑØ�>‰>Ð%Ø#Ÿ~™~ˆD�ÑØ�9‰9Ð ØŸ9™9ˆD�‰LØˆr   c           	      ó  — | j                   rd| j                   › �nd}| j                  rd| j                  › �nd}ddddœj                  | j                  d«      }d| j                  › d| j
                  › |› |› d	| j                  › |› �	S )
zDReturn the volume as an HF handle in the format expected by the CLI.ú/Ú ú@z:roz:rw)TFNzhf://zs/ú:)rX   rV   r]   rW   rS   rT   rU   )r^   rX   rV   Úros       r   Úto_hf_handlezVolume.to_hf_handle¤   s‚   € à"&§)¢)��4—9‘9�+‰°ˆØ*.¯-ª-�Q�t—}‘}�oÑ&¸RˆØ %¨rÑ2×6Ñ6°t·~±~ÀrÓJˆØ�t—y‘y�k  D§K¡K =°°
¸4¸&ÀÀ$Ç/Á/ÐARÐSUÐRVÐWÐWr   )rY   N)r   r   r   r   r   Ú__annotations__ÚstrrV   rW   ÚboolrX   r`   Údictrd   rk   r   r   r   rN   rN   p   sh   … ñð$ Ð7Ñ
8Ó8ØƒKØƒOØ€Hˆc�D‰jÓØ!€Iˆt�d‰{Ó!Ø€Dˆ#�‰*Óó'ð˜ó ðX˜cô Xr   rN   c                   óX   — e Zd ZU ed   ed<   eeeedz  f      ed<   eed<   deddfd„Z	y)	ÚSpaceHotReloading)ÚcreatedÚcanceledÚstatusNÚreplica_statusesÚrawrc   rY   c                 ó:   — |d   | _         |d   | _        || _        y )Nrt   ÚreplicaStatuses)rt   ru   rv   rb   s     r   r`   zSpaceHotReloading.__init__²   s"   € Ø˜8‘nˆŒØ $Ð%6Ñ 7ˆÔØˆ�r   )
r   r   r   r   rl   ÚlistÚtuplerm   ro   r`   r   r   r   rq   rq   ¬   s>   … àÐ)Ñ*Ó*Ø˜5  c¨D¡j Ñ1Ñ2Ó2Ø	ƒIð˜Tð  dô r   rq   c                   óœ   — e Zd ZU dZeed<   edz  ed<   edz  ed<   edz  ed<   edz  ed<   e	dz  ed<   e
e   dz  ed	<   eed
<   deddfd„Zy)ÚSpaceRuntimeaƒ  
    Contains information about the current runtime of a Space.

    Args:
        stage (`str`):
            Current stage of the space. Example: RUNNING.
        hardware (`str` or `None`):
            Current hardware of the space. Example: "cpu-basic". Can be `None` if Space
            is `BUILDING` for the first time.
        requested_hardware (`str` or `None`):
            Requested hardware. Can be different from `hardware` especially if the request
            has just been made. Example: "t4-medium". Can be `None` if no hardware has
            been requested yet.
        sleep_time (`int` or `None`):
            Number of seconds the Space will be kept alive after the last request. By default (if value is `None`), the
            Space will never go to sleep if it's running on an upgraded hardware, while it will go to sleep after 48
            hours on a free 'cpu-basic' hardware. For more details, see https://huggingface.co/docs/hub/spaces-gpus#sleep-time.
        volumes (`list[Volume]` or `None`):
            List of volumes mounted in the Space. Each volume is a [`Volume`] object describing its type, source,
            mount path, and optional settings. `None` if no volumes are attached.
        raw (`dict`):
            Raw response from the server. Contains more information about the Space
            runtime like number of replicas, number of cpu, memory size,...
    ÚstageNÚhardwareÚrequested_hardwareÚ
sleep_timeÚstorageÚhot_reloadingÚvolumesrv   rc   rY   c                 óÐ  — |d   | _         |j                  di «      j                  d«      | _        |j                  di «      j                  d«      | _        |j                  d«      | _        |j                  d«      | _        |j                  d«      x}�t        |«      nd | _        |j                  d«      }|�|D �cg c]  }t        d	i |¤Ž‘Œ c}nd | _	        || _
        y c c}w )
Nr}   r~   ÚcurrentÚ	requestedÚ	gcTimeoutr�   ÚhotReloadingrƒ   r   )r}   r]   r~   r   r€   r�   rq   r‚   rN   rƒ   rv   )r^   rc   Úraw_hrÚraw_volumesÚvs        r   r`   zSpaceRuntime.__init__Ü   sÆ   € Ø˜'‘]ˆŒ
ØŸ™ ¨RÓ0×4Ñ4°YÓ?ˆŒØ"&§(¡(¨:°rÓ":×">Ñ">¸{Ó"KˆÔØŸ(™( ;Ó/ˆŒØ—x‘x 	Ó*ˆŒØEIÇXÁXÈnÓE]Ð;]¸6Ð:jÔ.¨vÔ6ÐptˆÔØ—h‘h˜yÓ)ˆØ=HÐ=T¨[Ö9¨œ™ ›Ó9ÐZ^ˆŒØˆ�ùò :s   Â?C#)r   r   r   r   r	   rl   r   ÚintrF   rq   ry   rN   ro   r`   r   r   r   r|   r|   ¸   sl   … ñð2 ÓØ˜dÑ"Ó"Ø%¨Ñ,Ó,Ø�d‘
ÓØ˜DÑ Ó Ø$ tÑ+Ó+Ø�&‰\˜DÑ Ó Ø	ƒIð	˜Tð 	 dô 	r   r|   c                   óZ   — e Zd ZU dZeed<   eed<   edz  ed<   edz  ed<   dededdfd	„Zy)
ÚSpaceVariablea  
    Contains information about the current variables of a Space.

    Args:
        key (`str`):
            Variable key. Example: `"MODEL_REPO_ID"`
        value (`str`):
            Variable value. Example: `"the_model_repo_id"`.
        description (`str` or None):
            Description of the variable. Example: `"Model Repo ID of the implemented model"`.
        updatedAt (`datetime` or None):
            datetime of the last update of the variable (if the variable has been updated at least once).
    ÚkeyÚvalueNÚdescriptionÚ
updated_atÚvaluesrY   c                 ó¨   — || _         |d   | _        |j                  d«      | _        |j                  d«      }|�t	        |«      | _        y d | _        y )Nr�   r‘   Ú	updatedAt)r�   r�   r]   r‘   r   r’   )r^   r�   r“   r’   s       r   r`   zSpaceVariable.__init__ý   sK   € ØˆŒØ˜G‘_ˆŒ
Ø!Ÿ:™: mÓ4ˆÔØ—Z‘Z Ó,ˆ
Ø8BÐ8Nœ.¨Ó4ˆ�ÐTXˆ�r   )	r   r   r   r   rm   rl   r   ro   r`   r   r   r   rŽ   rŽ   è   sE   … ñð 
ƒHØƒJØ�t‘ÓØ˜4‘ÓðY˜Cð Y¨ð Y°$ô Yr   rŽ   c                   óÚ   — e Zd ZU dZeed<   eed<   eed<   edz  ed<   edz  ed<   eed<   eed	<   ee   dz  ed
<   e	dz  ed<   edz  ed<   edz  ed<   e
dz  ed<   edz  ed<   deddfd„Zy)ÚSpaceSearchResulta“  A single result from the Spaces semantic search API.

    Returned by [`HfApi.search_spaces`].

    Attributes:
        id (`str`):
            ID of the Space (e.g. `"username/repo-name"`).
        author (`str`):
            Author of the Space.
        title (`str`):
            Display title of the Space.
        emoji (`str` or `None`):
            Emoji icon of the Space.
        sdk (`str` or `None`):
            SDK used by the Space (e.g. `"gradio"`, `"docker"`, `"static"`).
        likes (`int`):
            Number of likes.
        private (`bool`):
            Whether the Space is private.
        tags (`list[str]` or `None`):
            List of tags.
        runtime ([`SpaceRuntime`] or `None`):
            Runtime information (stage, hardware, etc.).
        ai_short_description (`str` or `None`):
            AI-generated short description.
        ai_category (`str` or `None`):
            AI-generated category (e.g. `"Image Generation"`).
        semantic_relevancy_score (`float` or `None`):
            Semantic relevancy score (0-1) relative to the search query.
        trending_score (`int` or `None`):
            Trending score.
    ÚidÚauthorÚtitleNÚemojiÚsdkÚlikesÚprivateÚtagsÚruntimeÚai_short_descriptionÚai_categoryÚsemantic_relevancy_scoreÚtrending_scorerc   rY   c                 óN  — |j                  d«      }|d   | _        |j                  dd«      | _        |j                  dd«      | _        |j                  d«      | _        |j                  d«      | _        |j                  dd	«      | _        |j                  d
d«      | _        |j                  d«      | _        |rt        |«      nd | _
        |j                  d«      | _        |j                  d«      | _        |j                  d«      | _        |j                  d«      | _        y )Nr    r˜   r™   rg   rš   r›   rœ   r�   r   rž   FrŸ   r¡   r¢   ÚsemanticRelevancyScoreÚtrendingScore)r]   r˜   r™   rš   r›   rœ   r�   rž   rŸ   r|   r    r¡   r¢   r£   r¤   )r^   rc   r    s      r   r`   zSpaceSearchResult.__init__6  sè   € Ø—(‘(˜9Ó%ˆØ�t‘*ˆŒØ—h‘h˜x¨Ó,ˆŒØ—X‘X˜g rÓ*ˆŒ
Ø—X‘X˜gÓ&ˆŒ
Ø—8‘8˜E“?ˆŒØ—X‘X˜g qÓ)ˆŒ
Ø—x‘x 	¨5Ó1ˆŒØ—H‘H˜VÓ$ˆŒ	Ù07”| GÔ,¸TˆŒØ$(§H¡HÐ-CÓ$DˆÔ!ØŸ8™8 MÓ2ˆÔØ(,¯©Ð1IÓ(JˆÔ%Ø"Ÿh™h Ó7ˆÕr   )r   r   r   r   rm   rl   rŒ   rn   ry   r|   Úfloatro   r`   r   r   r   r—   r—     s‹   … ñðB 	ƒGØƒKØƒJØ�‰:ÓØ	ˆt‰ƒOØƒJØƒMØ
ˆs‰)�dÑ
ÓØ˜DÑ Ó Ø ™*Ó$Ø�t‘ÓØ# d™lÓ*Ø˜$‘JÓð8˜Tð 8 dô 8r   r—   N)Údataclassesr   r   Úenumr   Útypingr   Úhuggingface_hub.utilsr   rm   r	   r   rF   rN   rq   r|   rŽ   r—   r   r   r   ú<module>r­      sÆ   ðõ "Ý Ý Ý å 0ô2��dô 2ô6+�C˜ô +ô\�3˜ô ð" ÷8Xð 8Xó ð8Xðv ÷ð ó ðð ÷,ð ,ó ð,ð^ ÷Yð Yó ðYð8 ÷>8ð >8ó ñ>8r   