Movatterモバイル変換


[0]ホーム

URL:


Hugging Face's logoHugging Face

Hub Python Library documentation

Managing your Space runtime

Hub Python Library

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

Collaborate on models, datasets and Spaces
Faster examples with accelerated inference
Switch between documentation themes

to get started

Managing your Space runtime

Check theHfApi documentation page for the reference of methods to manage your Space on the Hub.

Data structures

SpaceRuntime

classhuggingface_hub.SpaceRuntime

<source>

(data: dict)

Parameters

  • stage (str) —Current stage of the space. Example: RUNNING.
  • hardware (str orNone) —Current hardware of the space. Example: “cpu-basic”. Can beNone if SpaceisBUILDING for the first time.
  • requested_hardware (str orNone) —Requested hardware. Can be different fromhardware especially if the requesthas just been made. Example: “t4-medium”. Can beNone if no hardware hasbeen requested yet.
  • sleep_time (int orNone) —Number of seconds the Space will be kept alive after the last request. By default (if value isNone), theSpace will never go to sleep if it’s running on an upgraded hardware, while it will go to sleep after 48hours on a free ‘cpu-basic’ hardware. For more details, seehttps://huggingface.co/docs/hub/spaces-gpus#sleep-time.
  • raw (dict) —Raw response from the server. Contains more information about the Spaceruntime like number of replicas, number of cpu, memory size,…

Contains information about the current runtime of a Space.

SpaceHardware

classhuggingface_hub.SpaceHardware

<source>

(valuenames = Nonemodule = Nonequalname = Nonetype = Nonestart = 1)

Enumeration of hardwares available to run your Space on the Hub.

Value can be compared to a string:

assert SpaceHardware.CPU_BASIC =="cpu-basic"

Taken fromhttps://github.com/huggingface-internal/moon-landing/blob/main/server/repo_types/SpaceHardwareFlavor.ts (private url).

SpaceStage

classhuggingface_hub.SpaceStage

<source>

(valuenames = Nonemodule = Nonequalname = Nonetype = Nonestart = 1)

Enumeration of possible stage of a Space on the Hub.

Value can be compared to a string:

assert SpaceStage.BUILDING =="BUILDING"

Taken fromhttps://github.com/huggingface/moon-landing/blob/main/server/repo_types/SpaceInfo.ts#L61 (private url).

SpaceStorage

classhuggingface_hub.SpaceStorage

<source>

(valuenames = Nonemodule = Nonequalname = Nonetype = Nonestart = 1)

Enumeration of persistent storage available for your Space on the Hub.

Value can be compared to a string:

assert SpaceStorage.SMALL =="small"

Taken fromhttps://github.com/huggingface/moon-landing/blob/main/server/repo_types/SpaceHardwareFlavor.ts#L24 (private url).

SpaceVariable

classhuggingface_hub.SpaceVariable

<source>

(key: strvalues: dict)

Parameters

  • 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).

Contains information about the current variables of a Space.

Update on GitHub


[8]ページ先頭

©2009-2026 Movatter.jp