mindscope-Model / src /features /feature_store.py
koushik2109's picture
Model Changes
8d7b4b1
Raw History Blame Contribute Delete
391 Bytes
import numpy as np
from pathlib import Path
from typing import Any, Dict
def save_features(path: Path, features: Dict[str, Any]) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
np.savez_compressed(path, **features)
def load_features(path: Path) -> Dict[str, np.ndarray]:
loaded = np.load(path, allow_pickle=True)
return {key: loaded[key] for key in loaded.files}