fix(dataset): Use provided episode_data in save_episode (#1740)

The 'episode_data' parameter was previously ignored, causing an error if provided. This change ensures it is correctly used, which allows for asynchronous episode saving by passing a copy of the episode buffer, preventing conflicts with the main data collection loop.
This commit is contained in:
lxk
2025-08-22 21:24:02 +08:00
committed by GitHub
parent 7f70b78f32
commit b0923ab74b

View File

@@ -825,6 +825,8 @@ class LeRobotDataset(torch.utils.data.Dataset):
"""
if not episode_data:
episode_buffer = self.episode_buffer
else:
episode_buffer = episode_data
validate_episode_buffer(episode_buffer, self.meta.total_episodes, self.features)