a
    º
þd  ã                   @   sb   d dl mZ d dlmZ d dlmZmZ G dd„ deeƒZG dd„ deeƒZ	eG dd	„ d	ƒƒZ
d
S )é    )Ú	dataclass)ÚEnum)ÚDictÚOptionalc                   @   s8   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S )Ú
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ÚPAUSEDN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r	   r
   r   r   r   r   r   r   © r   r   úc/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/huggingface_hub/_space_api.pyr      s   r   c                   @   s,   e Zd ZdZdZdZdZdZdZdZ	dZ
d	S )
Ú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/moon-landing/blob/main/server/repo_types/SpaceInfo.ts#L73 (private url).
    z	cpu-basiczcpu-upgradezt4-smallz	t4-mediumz
a10g-smallz
a10g-largez
a100-largeN)r   r   r   r   Z	CPU_BASICZCPU_UPGRADEZT4_SMALLZ	T4_MEDIUMZ
A10G_SMALLZ
A10G_LARGEZ
A100_LARGEr   r   r   r   r   -   s   r   c                   @   sV   e Zd ZU dZeed< ee ed< ee ed< ee ed< e	ed< e	ddœd	d
„Z
dS )Ú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 than `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.
        raw (`dict`):
            Raw response from the server. Contains more information about the Space
            runtime like number of replicas, number of cpu, memory size,...
    ÚstageÚhardwareÚrequested_hardwareÚ
sleep_timeÚrawN)ÚdataÚreturnc                 C   s:   |d | _ |d d | _|d d | _|d | _|| _d S )Nr   r   ÚcurrentÚ	requestedZ	gcTimeout)r   r   r   r   r   )Úselfr   r   r   r   Ú__init__`   s
    

zSpaceRuntime.__init__)r   r   r   r   r   Ú__annotations__r   r   Úintr   r#   r   r   r   r   r   B   s   
r   N)Zdataclassesr   Úenumr   Útypingr   r   Ústrr   r   r   r   r   r   r   Ú<module>   s   