Merge branch 'main' into feat/minimal_default_install

This commit is contained in:
Steven Palma
2026-04-10 20:57:38 +02:00
committed by GitHub
3 changed files with 36 additions and 0 deletions
+10
View File
@@ -180,6 +180,16 @@ class LeRobotDatasetMetadata:
self.episodes = load_episodes(self.root)
self.stats = load_stats(self.root)
def ensure_readable(self) -> None:
"""Guarantee metadata is fully loaded for read operations.
Idempotent — when metadata is already in memory this is a single
``is None`` check. Call this before transitioning from write to
read mode on the same instance.
"""
if self.episodes is None:
self._load_metadata()
def _pull_from_repo(
self,
allow_patterns: list[str] | str | None = None,
+1
View File
@@ -278,6 +278,7 @@ class LeRobotDataset(torch.utils.data.Dataset):
def _ensure_reader(self) -> DatasetReader:
"""Lazily create the reader on first access."""
if self.reader is None:
self.meta.ensure_readable()
self.reader = DatasetReader(
meta=self.meta,
root=self.root,