physioex.models.load_embeddings#
- physioex.models.load_embeddings(model_name, dataset_name, cache_dir=None, verbose=False)[source]#
Load cached embeddings, downloading from HuggingFace if needed.
Checks the local cache first. If embeddings are not found locally, downloads them from
4rooms/{model_name}-embeddingson HuggingFace Hub (one dataset repo per model).- Parameters:
- Returns:
Path to the local embeddings directory containing per-subject subdirectories with
embeddings.npyandlabels.npy.- Return type:
Example:
from physioex.models import load_embeddings path = load_embeddings("seqsleepnet-phan", "sleepedf", verbose=True) # path / "SC4001E0" / "embeddings.npy" -> (n_epochs, 128)