wL i^ddlmZddlmZddlmZddlmZmZddlm Z Gdde eZ Gdd e eZ Gd d e eZ eGd d ZeGddZy)) dataclass)datetime)Enum)DictOptional)parse_datetimec8eZdZdZdZdZdZdZdZdZ dZ 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_ERRORBUILDING BUILD_ERRORRUNNINGRUNNING_BUILDING RUNTIME_ERRORDELETINGSTOPPEDPAUSEDN)__name__ __module__ __qualname____doc__r r r rrrrrrr`/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/huggingface_hub/_space_api.pyr r s<  K!LHKG)#MHG Frr cXeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZy) 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-upgradezcpu-xlz zero-a10gzt4-smallz t4-mediuml4x1l4x4l40sx1l40sx4l40sx8z a10g-smallz a10g-largez a10g-largex2z a10g-largex4z a100-largeh100h100x8N)rrrr CPU_BASIC CPU_UPGRADECPU_XL ZERO_A10GT4_SMALL T4_MEDIUML4X1L4X4L40SX1L40SX4L40SX8 A10G_SMALL A10G_LARGE A10G_LARGEX2 A10G_LARGEX4 A100_LARGEH100H100X8rrrrr0sg IK FIHI D D F F FJJ!L!LJ D FrrceZdZdZdZdZdZy) 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). smallmediumlargeN)rrrrSMALLMEDIUMLARGErrrr8r8Us  E F Err8cveZdZUdZeed<eeed<eeed<eeed<ee ed<e ed<de d d fd 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 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,... stagehardwarerequested_hardware sleep_timestoragerawdatareturnNc|d|_|jdijd|_|jdijd|_|jd|_|jd|_||_y)NrArBcurrent requested gcTimeoutrE)rAgetrBrCrDrErF)selfrGs r__init__zSpaceRuntime.__init__so'] R044Y? "&((:r":">">{"K((;/xx * r) rrrrr __annotations__rrintr8rrOrrrr@r@fsR, }%% //  l ## ITdrr@cZeZdZUdZeed<eed<eeed<eeed<dededdfd 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). keyvalue description updated_atvaluesrHNc||_|d|_|jd|_|jd}|t ||_yd|_y)NrUrV updatedAt)rTrUrMrVrrW)rNrTrXrWs rrOzSpaceVariable.__init__sKG_ !::m4ZZ , 8B8N.4TXr) rrrrstrrPrrrrOrrrrSrSsF  H J#""YCYY$YrrSN) dataclassesrrenumrtypingrrhuggingface_hub.utilsrr[r rr8r@rSrrrr`sw"!0d2"C"J3" $$ $N YY Yr