( repo_id: str revision: typing.Optional[str] = None version: typing.Optional[str] = None ) → ModuleType
Parameters
str) —
The Hub repository containing the kernel. str, optional, defaults to "main") —
The specific revision (branch, tag, or commit) to download. Cannot be used together with version. str, optional) —
The kernel version to download. This can be a Python version specifier, such as ">=1.0.0,<2.0.0".
Cannot be used together with revision. Returns
ModuleType
The imported kernel module.
Load a kernel from the kernel hub.
This function downloads a kernel to the local Hugging Face Hub cache directory (if it was not downloaded before) and then loads the kernel.
( repo_id: str revision: typing.Optional[str] = None version: typing.Optional[str] = None ) → bool
Parameters
str) —
The Hub repository containing the kernel. str, optional, defaults to "main") —
The specific revision (branch, tag, or commit) to download. Cannot be used together with version. str, optional) —
The kernel version to download. This can be a Python version specifier, such as ">=1.0.0,<2.0.0".
Cannot be used together with revision. Returns
bool
True if a kernel is available for the current environment.
Check whether a kernel build exists for the current environment (Torch version and compute framework).
( repo_id: str lockfile: typing.Optional[pathlib.Path] = None ) → ModuleType
Get a pre-downloaded, locked kernel.
If lockfile is not specified, the lockfile will be loaded from the caller’s package metadata.
( repo_id: str local_files_only: bool = False ) → ModuleType
Get a kernel using a lock file.